aboutsummaryrefslogtreecommitdiff
path: root/advtrains/advtrains_luaautomation/passive.lua
diff options
context:
space:
mode:
Diffstat (limited to 'advtrains/advtrains_luaautomation/passive.lua')
-rw-r--r--advtrains/advtrains_luaautomation/passive.lua10
1 files changed, 6 insertions, 4 deletions
diff --git a/advtrains/advtrains_luaautomation/passive.lua b/advtrains/advtrains_luaautomation/passive.lua
index e32bee9..774df8a 100644
--- a/advtrains/advtrains_luaautomation/passive.lua
+++ b/advtrains/advtrains_luaautomation/passive.lua
@@ -1,8 +1,9 @@
-- passive.lua
-- API to passive components, as described in passive_api.txt
-local function getstate(pos)
- if not type(pos)=="table" or not pos.x or not pos.y or not pos.z then
+local function getstate(parpos)
+ local pos=atlatc.pcnaming.resolve_pos(parpos)
+ if type(pos)~="table" or (not pos.x or not pos.y or not pos.z) then
debug.sethook()
error("Invalid position supplied to getstate")
end
@@ -19,8 +20,9 @@ local function getstate(pos)
return nil
end
-local function setstate(pos, newstate)
- if not type(pos)=="table" or not pos.x or not pos.y or not pos.z then
+local function setstate(parpos, newstate)
+ local pos=atlatc.pcnaming.resolve_pos(parpos)
+ if type(pos)~="table" or (not pos.x or not pos.y or not pos.z) then
debug.sethook()
error("Invalid position supplied to setstate")
end