Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
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
- Loading branch information
Showing
with
103 additions
and 109 deletions.
- +3 −4 src/content_sao.cpp
- +4 −10 src/content_sao.h
- +1 −1 src/game.cpp
- +2 −0 src/localplayer.h
- +3 −3 src/network/clientpackethandler.cpp
- +23 −8 src/network/serverpackethandler.cpp
- +24 −38 src/player.h
- +2 −2 src/script/lua_api/l_env.cpp
- +8 −8 src/script/lua_api/l_object.cpp
- +2 −1 src/script/lua_api/l_object.h
- +24 −28 src/server.cpp
- +7 −6 src/server.h
Oops, something went wrong.