Fix crash on login to zone

Fixes 

Client gets ahead of server, tries to get character info before we set appropriate structures for client to use
This commit is contained in:
Image 2020-03-25 21:06:18 -04:00
parent d11d58df75
commit 1dfbf01cf4
3 changed files with 3 additions and 6 deletions

View file

@ -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);

View file

@ -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;

View file

@ -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;