From 0210252be7c17745fa30220e12c19e0d2f19af02 Mon Sep 17 00:00:00 2001 From: busheezy Date: Sun, 21 Mar 2021 02:26:55 -0500 Subject: [PATCH] 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. --- resources/[managers]/spawnmanager/spawnmanager.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/resources/[managers]/spawnmanager/spawnmanager.lua b/resources/[managers]/spawnmanager/spawnmanager.lua index 1a3353f..9e940d8 100644 --- a/resources/[managers]/spawnmanager/spawnmanager.lua +++ b/resources/[managers]/spawnmanager/spawnmanager.lua @@ -222,6 +222,13 @@ function spawnPlayer(spawnIdx, cb) if type(spawnIdx) == 'table' then 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 spawn = spawnPoints[spawnIdx] end