MCPcopy Create free account
hub / github.com/DFHack/dfhack / unitPosAtTime

Function unitPosAtTime

plugins/siege-engine.cpp:1325–1339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1323}
1324
1325static int unitPosAtTime(lua_State *L)
1326{
1327 auto unit = Lua::CheckDFObject<df::unit>(L, 1);
1328 float time = luaL_checknumber(L, 2);
1329
1330 CHECK_NULL_POINTER(unit);
1331
1332 float lmargin, rmargin;
1333 auto info = UnitPath::get(unit);
1334
1335 Lua::Push(L, info->posAtTime(time, &lmargin, &rmargin));
1336 push_margin(L, lmargin);
1337 push_margin(L, rmargin);
1338 return 3;
1339}
1340
1341static bool canTargetUnit(df::unit *unit)
1342{

Callers

nothing calls this directly

Calls 5

luaL_checknumberFunction · 0.85
PushFunction · 0.85
push_marginFunction · 0.85
posAtTimeMethod · 0.80
getFunction · 0.70

Tested by

no test coverage detected