1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-09-15 18:57:08 +00:00

More code cleanup (UNORDERED + RemotePlayer/LocalPlayer)

* ClientEnvironment now uses UNORDERED MAP for active objects
* Use RemotePlayer and LocalPlayer everywhere it's possible
* Minor code style fixes
* Drop Client::getBreath() unused function
This commit is contained in:
Loic Blot 2016-10-08 16:31:22 +02:00 committed by Ner'zhul
parent 067766eec2
commit fd5a130b86
10 changed files with 124 additions and 152 deletions

View file

@ -655,12 +655,11 @@ void GenericCAO::initialize(const std::string &data)
if(m_is_player)
{
Player *player = m_env->getPlayer(m_name.c_str());
if(player && player->isLocal())
{
LocalPlayer *player = m_env->getPlayer(m_name.c_str());
if (player && player->isLocal()) {
m_is_local_player = true;
m_is_visible = false;
LocalPlayer* localplayer = dynamic_cast<LocalPlayer*>(player);
LocalPlayer* localplayer = player;
assert( localplayer != NULL );
localplayer->setCAO(this);