Fix ActiveObject creation for fast player respawns
parent
67c21fc42f
commit
9344816bd6
|
@ -1348,6 +1348,15 @@ void Server::AsyncRunStep()
|
||||||
if(player->m_hp_not_sent){
|
if(player->m_hp_not_sent){
|
||||||
SendPlayerHP(player);
|
SendPlayerHP(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Add to environment if is not in respawn screen
|
||||||
|
*/
|
||||||
|
if(!player->m_is_in_environment && !player->m_respawn_active){
|
||||||
|
player->m_removed = false;
|
||||||
|
player->setId(0);
|
||||||
|
m_env->addActiveObject(player);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2127,11 +2136,6 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add PlayerSAO
|
|
||||||
player->m_removed = false;
|
|
||||||
player->setId(0);
|
|
||||||
m_env->addActiveObject(player);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Answer with a TOCLIENT_INIT
|
Answer with a TOCLIENT_INIT
|
||||||
*/
|
*/
|
||||||
|
@ -2888,9 +2892,8 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
|
||||||
actionstream<<player->getName()<<" respawns at "
|
actionstream<<player->getName()<<" respawns at "
|
||||||
<<PP(player->getPosition()/BS)<<std::endl;
|
<<PP(player->getPosition()/BS)<<std::endl;
|
||||||
|
|
||||||
srp->m_removed = false;
|
// ActiveObject is added to environment in AsyncRunStep after
|
||||||
srp->setId(0);
|
// the previous addition has been succesfully removed
|
||||||
m_env->addActiveObject(srp);
|
|
||||||
}
|
}
|
||||||
else if(command == TOSERVER_INTERACT)
|
else if(command == TOSERVER_INTERACT)
|
||||||
{
|
{
|
||||||
|
|
|
@ -92,9 +92,9 @@ public:
|
||||||
bool m_inventory_not_sent;
|
bool m_inventory_not_sent;
|
||||||
bool m_hp_not_sent;
|
bool m_hp_not_sent;
|
||||||
bool m_respawn_active;
|
bool m_respawn_active;
|
||||||
|
bool m_is_in_environment;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_is_in_environment;
|
|
||||||
bool m_position_not_sent;
|
bool m_position_not_sent;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue