fixed accidentally overwriting grid id sent to clients in zones where they have a different map than the other spawn
This commit is contained in:
parent
60708af958
commit
b695a33a74
@ -2063,7 +2063,7 @@ void Spawn::InitializePosPacketData(Player* player, PacketStruct* packet, bool b
|
|||||||
{
|
{
|
||||||
m_GridMutex.writelock(__FUNCTION__, __LINE__);
|
m_GridMutex.writelock(__FUNCTION__, __LINE__);
|
||||||
std::map<int32,TimedGridData>::iterator itr = established_grid_id.find(version);
|
std::map<int32,TimedGridData>::iterator itr = established_grid_id.find(version);
|
||||||
if ( itr == established_grid_id.end() || itr->second.timestamp <= (Timer::GetCurrentTime2()))
|
if ( itr == established_grid_id.end() || itr->second.npc_save || itr->second.timestamp <= (Timer::GetCurrentTime2()))
|
||||||
{
|
{
|
||||||
if(itr != established_grid_id.end() && itr->second.x == GetX() && itr->second.z == GetZ() && !itr->second.npc_save) {
|
if(itr != established_grid_id.end() && itr->second.x == GetX() && itr->second.z == GetZ() && !itr->second.npc_save) {
|
||||||
itr->second.timestamp = Timer::GetCurrentTime2()+100;
|
itr->second.timestamp = Timer::GetCurrentTime2()+100;
|
||||||
@ -2081,7 +2081,7 @@ void Spawn::InitializePosPacketData(Player* player, PacketStruct* packet, bool b
|
|||||||
new_y = player->FindBestZ(loc, nullptr, &new_grid_id, &new_widget_id);
|
new_y = player->FindBestZ(loc, nullptr, &new_grid_id, &new_widget_id);
|
||||||
float zone_ground_y = new_y;
|
float zone_ground_y = new_y;
|
||||||
if(player->GetMap() != GetMap()) {
|
if(player->GetMap() != GetMap()) {
|
||||||
zone_ground_y = FindBestZ(loc, nullptr, &new_grid_id, &new_widget_id);
|
zone_ground_y = FindBestZ(loc, nullptr, nullptr, nullptr);
|
||||||
}
|
}
|
||||||
TimedGridData data;
|
TimedGridData data;
|
||||||
data.grid_id = new_grid_id;
|
data.grid_id = new_grid_id;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user