1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

RemotePlayer/LocalPlayer Player base class proper separation (code cleanup) (patch 3 of X)

* remove IGameDef from Player class, only LocalPlayer has it now
* move many attributes/functions only used by LocalPlayer from Player to LocalPlayer
* move many attributes/functions only used by RemotePlayer from Player to RemotePlayer
* make some functions const
* hudGetHotbarSelectedImage now returns const ref
* RemotePlayer getHotbarSelectedImage now returns const ref
* various code style fixes
This commit is contained in:
Loic Blot 2016-10-08 17:56:38 +02:00 committed by Ner'zhul
parent edba6e50d9
commit 7bbd716426
9 changed files with 255 additions and 292 deletions

View file

@ -1600,7 +1600,7 @@ int ObjectRef::l_hud_get_hotbar_selected_image(lua_State *L)
if (player == NULL)
return 0;
std::string name = getServer(L)->hudGetHotbarSelectedImage(player);
const std::string &name = getServer(L)->hudGetHotbarSelectedImage(player);
lua_pushlstring(L, name.c_str(), name.size());
return 1;
}