TESTS: extended lua registry tests

master
Martin Gerhardy 2020-07-16 00:19:52 +02:00
parent 4e22785659
commit 171897dc60
1 changed files with 8 additions and 0 deletions

View File

@ -17,7 +17,15 @@ local luatest = REGISTRY.createNode("LuaTest")
function luatest:execute(ai, deltaMillis)
--print("LuaTest node execute called with parameters: ai=["..tostring(ai).."], deltaMillis=["..tostring(deltaMillis).."]")
local chr = ai:character()
if chr == nil then
print("error: ai has no character assigned")
return FAILED
end
local pos = chr:position()
if pos == nil then
print("error: could not get character position")
return FAILED
end
local x = pos.x
pos.x = pos.x + 1.0
pos.y = 0.5