View Issue Details

IDProjectCategoryView StatusLast Update
0000288ServerServerpublic2021-03-12 21:53
Reporteruser15Assigned To 
PriorityhighSeveritymajorReproducibilityalways
Status newResolutionopen 
Platformx64OSWindowsOS Version10
Product Version1.1.21 
Summary0000288: [Server side, At least VC] civilian.setData(str, VehHandle) causes that created civilian to not appear in-game
Description

Sending a vehicle handle to the setData method on a civilian object, can cause the civilian to not appear in-game.
Tested server-side for VC.

Steps To Reproduce

The following partial-code reproduces the resulting error for me every time: (Server side code)

[code]

for(var i=0; i<vehicleCivilianCount; i++)
{
    var pedType = PEDTYPE_SPECIAL;
    var model = i == 0 ? driverSkinId : utility.getRandomPedModel();
    var pos2 = new Vec3(pos.x + 1, pos.y + 1, pos.z + 1);

    var civilian = gta.createCivilian(model, pos2, pedType);
    if(!civilian)
    {
        clearCivilians();
        return;
    }

    civilians.push(civilian);
}

var vehicle = gta.createVehicle(vehicleModelId, pos);
if(!vehicle)
{
    clearCivilians();
    return;
}

vehicle.heading = zrotation - utility.radians(90);
vehicle.setData('traffic', 1);

addToWorld(vehicle);

for(var i=0; i<civilians.length; i++)
{
    civilians[i].setData('traffic', 1);
    //civilians[i].setData('vehicle', vehicle); // <--------- This line of code causes the created civilians to not appear. Without this line of code the civilians appear.

    addToWorld(civilians[i]);
}

traffic.elements.set(vehicle, [civilians, vehicle]);

};
[/code]

Additional Information

Perhaps it is something to do with the vehicle and civilian being created right before the setData call.

TagsNo tags attached.
Game

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2021-03-12 21:53 user15 New Issue