Browse Source

player position update crash fix

Image 4 years ago
parent
commit
01c5cb33a0
2 changed files with 7 additions and 1 deletions
  1. 5 0
      EQ2/source/WorldServer/Spawn.cpp
  2. 2 1
      EQ2/source/WorldServer/client.cpp

+ 5 - 0
EQ2/source/WorldServer/Spawn.cpp

@@ -619,6 +619,11 @@ EQ2Packet* Spawn::player_position_update_packet(Player* player, int16 version){
 	static const int8 vis_size = 1;
 	m_Update.writelock(__FUNCTION__, __LINE__);
 	uchar* pos_changes = spawn_pos_changes(player, version);
+	if (pos_changes == NULL )
+	{
+		return NULL;
+	}
+
 	int32 tmp_pos_packet_size = pos_packet_size;
 	m_Update.releasewritelock(__FUNCTION__, __LINE__);
 

+ 2 - 1
EQ2/source/WorldServer/client.cpp

@@ -2467,6 +2467,7 @@ bool Client::Process(bool zone_process) {
 
 		delete app;
 	}
+
 	if (GetCurrentZone() && GetCurrentZone()->GetSpawnByID(GetPlayer()->GetID()) && should_load_spells) {
 		player->ApplyPassiveSpells();
 		//database.LoadCharacterActiveSpells(player);
@@ -2489,7 +2490,7 @@ bool Client::Process(bool zone_process) {
 		LogWrite(CCLIENT__DEBUG, 1, "Client", "%s, CheckQuestQueue", __FUNCTION__, __LINE__);
 		CheckQuestQueue();
 	}
-	if (pos_update.Check() && player_pos_changed) {
+	if (pos_update.Check() && player_pos_changed && IsReadyForUpdates() && ( !disconnect_timer || !disconnect_timer->Enabled())) {
 		//GetPlayer()->CalculateLocation();
 		client_list.CheckPlayersInvisStatus(this);
 		GetCurrentZone()->SendPlayerPositionChanges(GetPlayer());