imagecode-git / slrr-javas

Street Legal Racing: Redline
3 stars 2 forks source link

Crash in the car dealer #3

Closed imagecode-git closed 2 years ago

imagecode-git commented 2 years ago
---
!Script error

Thread: THRD-RUNVMI Dummy.handleEvent
Error: Thread::evalName: null.methodcall()

java.game.CarMarket:enter (line:503)
java.game.GameLogic:changeActiveSection (line:850)
java.game.Garage:osdCommand (line:1552)
java.render.osd.Gadget:sendMessage (line:259)
java.render.osd.Button:click (line:31)
java.render.Group:handleEvent (line:178)
imagecode-git commented 2 years ago

Quick solution:

Vehicle car = new Vehicle(map, vd.id, vd.colorIndex, vd.optical, vd.power, vd.wear, vd.tear);

//broken vehicle descriptors patch
if(!car || !car.chassis)
{
    int vt_patch = VehicleType.VS_STOCK;
    if(used) vt_patch = VehicleType.VS_USED;

    VehicleDescriptor vd_patch = GameLogic.getVehicleDescriptor(vt_patch);
    car = new Vehicle(map, vd_patch.id, vd_patch.colorIndex, vd_patch.optical, vd_patch.power, vd_patch.wear, vd_patch.tear);
}