Qbox-project / qbx_core

http://qbox-project.github.io
Other
45 stars 109 forks source link

Spawning vehicle with warp can fail to set vehicle properties #501

Closed Manason closed 3 days ago

Manason commented 4 days ago

Summary

When the warping client isn't the entity owner, the vehicle properties seem to fail to set

Reproduction

  1. Have two clients in close proximity
  2. run spawnrepo a few times until the license plate of the spawned vehicle is not 'TEST'
    RegisterCommand('spawnrepro', function(source)
    qbx.spawnVehicle({ spawnSource = vec4(228.5577, -802.1774, 30.5724, 159.7563), model = 'adder', props = {plate = 'TEST'}, warp = GetPlayerPed(source)})
    end)

Expected behavior

The license plate of the spawned vehicle is 'TEST' since that's the property that was passed in.

Actual behavior

The license plate has a chance of not being 'TEST'

Additional context

This occurs when the vehicle entity owner is the client who is not running the spawnrepro command. I suspect there is a race condition that takes away ownership before the properties can be set, leading to default GTA properties instead, although I haven't been able to nail down a root cause.

Current Version

v1.15.0

Custom Resources

N/A