add checks for gate definition errors

This commit is contained in:
Redo
2020-09-09 23:00:29 -05:00
parent 94bb85c31d
commit 1dce343c87
2 changed files with 7 additions and 1 deletions

View File

@@ -145,7 +145,10 @@ while 1 do
i = i + 4
elseif data[i] == "G" then
local objref = tonumber(data[i+1])
local definition = sim:getdefinitionbyref(tonumber(data[i+2])) or GateDefinition
local definition = sim:getdefinitionbyref(tonumber(data[i+2]))
assert(definition, "No gate definition for objref "..objref)
local position = vectotable(data[i+3])
local rotation = tonumber(data[i+4])
local gate = definition:constructgate(objref, position, rotation)