diff --git a/source/game/scripting/StarWorldLuaBindings.cpp b/source/game/scripting/StarWorldLuaBindings.cpp index dc1c5be..1a21bad 100644 --- a/source/game/scripting/StarWorldLuaBindings.cpp +++ b/source/game/scripting/StarWorldLuaBindings.cpp @@ -354,8 +354,10 @@ namespace LuaBindings { return as(world)->dungeonId(position); } }); - + if (auto clientWorld = as(world)) { + callbacks.registerCallback("isClient", []() { return true; }); + callbacks.registerCallback("isServer", []() { return false; }); callbacks.registerCallbackWithSignature("clientWindow", bind(ClientWorldCallbacks::clientWindow, clientWorld)); callbacks.registerCallback("players", [clientWorld]() { List playerIds; @@ -370,6 +372,9 @@ namespace LuaBindings { } if (auto serverWorld = as(world)) { + callbacks.registerCallback("isClient", []() { return false; }); + callbacks.registerCallback("isServer", []() { return true; }); + callbacks.registerCallbackWithSignature("breakObject", bind(ServerWorldCallbacks::breakObject, serverWorld, _1, _2)); callbacks.registerCallbackWithSignature("isVisibleToPlayer", bind(ServerWorldCallbacks::isVisibleToPlayer, serverWorld, _1)); callbacks.registerCallbackWithSignature("loadRegion", bind(ServerWorldCallbacks::loadRegion, serverWorld, _1));