compile with luagate

This commit is contained in:
Bluub
2021-06-14 15:32:07 +02:00
parent a6140f6087
commit fb53f4b5b7
7 changed files with 36 additions and 25 deletions
@@ -48,12 +48,13 @@ namespace BBM
MapInfo player(pos.position, MapGenerator::NOTHING);
UpdateMapInfos(entity);
luabridge::getGlobalNamespace(ia.state)
.beginNamespace ("luaBBM")
.addFunction("isInExplosionRange", IAControllableSystem::isInExplosionRange)
.endNamespace();
luabridge::LuaRef updateFunc = luabridge::getGlobal(ia.state, "Update");
ia._state.callFunction("Update", 0, 4);
controllable.bomb = ia._state.getReturnBool();
controllable.jump = ia._state.getReturnBool();
controllable.move.y = ia._state.getReturnNumber();
controllable.move.x = ia._state.getReturnNumber();
/*
luabridge::LuaRef updateFunc = luabridge::getGlobal(ia.state, "Update");
if (!updateFunc.isFunction())
return;
luabridge::LuaResult res = updateFunc(player, _map, _players);
@@ -68,6 +69,7 @@ namespace BBM
controllable.jump = res[2];
if (res[3].isBool())
controllable.bomb = res[3];
*/
}
void IAControllableSystem::onSelfUpdate()