Browse Source

Fix crash on login to zone

Fixes #59

Client gets ahead of server, tries to get character info before we set appropriate structures for client to use
Image 4 years ago
parent
commit
1dfbf01cf4

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

@@ -937,6 +937,7 @@ bool Client::HandlePacket(EQApplicationPacket *app) {
 							GetCurrentZone()->AddClient(this); //add to zones client list
 							world.RejoinGroup(this);
 							zone_list.AddClientToMap(player->GetName(), this);
+							GetCurrentZone()->SetSpawnStructs(this);
 						}
 						else{
 							LogWrite(WORLD__ERROR, 0, "World", "Incompatible version: %i", version);

+ 1 - 4
EQ2/source/WorldServer/zoneserver.cpp

@@ -1069,10 +1069,7 @@ void ZoneServer::CheckSendSpawnToClient(Client* client, bool initial_login) {
 		return;
 	}
 
-	if (initial_login){
-		SetSpawnStructs(client);
-	}
-	else if (!client->GetInitialSpawnsSent())
+	if (!initial_login && !client->GetInitialSpawnsSent())
 		return;
 
 	Spawn* spawn = 0;

+ 1 - 2
EQ2/source/WorldServer/zoneserver.h

@@ -598,6 +598,7 @@ public:
 
 	void ProcessSpawnConditional(int8 condition);
 
+	void SetSpawnStructs(Client* client);
 private:
 	/* Private Functions */
 	void	AddTransporter(LocationTransportDestination* loc);
@@ -674,8 +675,6 @@ private:
 	///<summary>Dismiss all pets in the zone, useful when the spell process needs to be reloaded</summary>
 	void DismissAllPets();																						// never used outside zone server
 
-	void SetSpawnStructs(Client* client);
-
 	/* Mutex Lists */
 	MutexList<int32> changed_spawns;										// int32 = spawn id
 	vector<Client*> clients;