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

Player/LocalPlayer/RemotePlayer inheritance cleanup (part 1 on X)

* LocalPlayer take ownership of maxHudId as it's the only caller
* RemotePlayer take ownership of day night ratio as it's the only user
* Pass getPlayerControl as const reference to prevent object copy on each call (perf improvement in ObjectRef::l_get_player_control call)
* getPlayerSAO is now only RemotePlayer call
* get/setHotbarItemCount is now RemotePlayer owned
* Server: Use RemotePlayer instead of Player object on concerned call to properly fix the object type
* PlayerSAO now uses RemotePlayer instead of Player because it's only server side
* ObjectRef::getplayer also returns RemotePlayer as it's linked with PlayerSAO
This commit is contained in:
Loic Blot 2016-10-08 10:38:04 +02:00 committed by Ner'zhul
parent 0264e38bff
commit 8bcd10b872
12 changed files with 103 additions and 109 deletions

View file

@ -2851,7 +2851,7 @@ void Game::processItemSelection(u16 *new_playeritem)
s32 wheel = input->getMouseWheel();
u16 max_item = MYMIN(PLAYER_INVENTORY_SIZE - 1,
player->hud_hotbar_itemcount - 1);
player->hud_hotbar_itemcount - 1);
s32 dir = wheel;