mirror of
https://github.com/citizenfx/cfx-server-data.git
synced 2025-01-09 14:52:54 +08:00
prevent errors when passing a spawn table rather an index (#158)
* prevent errors when passing a spawn table rather an index * revise so I don't add anything to the values.
This commit is contained in:
parent
992cbb90b5
commit
0210252be7
@ -222,6 +222,13 @@ function spawnPlayer(spawnIdx, cb)
|
|||||||
|
|
||||||
if type(spawnIdx) == 'table' then
|
if type(spawnIdx) == 'table' then
|
||||||
spawn = spawnIdx
|
spawn = spawnIdx
|
||||||
|
|
||||||
|
-- prevent errors when passing spawn table
|
||||||
|
spawn.x = spawn.x + 0.00
|
||||||
|
spawn.y = spawn.y + 0.00
|
||||||
|
spawn.z = spawn.z + 0.00
|
||||||
|
|
||||||
|
spawn.heading = spawn.heading and (spawn.heading + 0.00) or 0
|
||||||
else
|
else
|
||||||
spawn = spawnPoints[spawnIdx]
|
spawn = spawnPoints[spawnIdx]
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user