mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
Zoning into a new zone did not properly display PCs with tree/object illusions
and NPCs wearing gear in non-weapon slots. The illusion thing: Not sure why, but te opcode for BulkZoneSpawn doesn't display the tree/object illusions. I did notice that even OP_Illusion gets rejected by the client if sent before Client_Ready. Maybe that is why. The BULKSpawns cannot be sent that late, I tried moving it in the sequence but it never did the illusions correctly, at any point. So, we new new the single spawn OP code for PCs with those illusions. This works. The NPC gear thing. Same story with BulkZoneSpawn, Not sure why. The data is sent correctly. So now we update the client zoning in (only them) with what the NPCs are wearing. Every othe client already is up to date.
This commit is contained in:
+34
-3
@@ -1149,19 +1149,50 @@ void EntityList::SendZoneSpawnsBulk(Client *client)
|
||||
NewSpawn_Struct ns;
|
||||
Mob *spawn;
|
||||
uint32 maxspawns = 100;
|
||||
EQApplicationPacket *app;
|
||||
|
||||
if (maxspawns > mob_list.size())
|
||||
maxspawns = mob_list.size();
|
||||
BulkZoneSpawnPacket *bzsp = new BulkZoneSpawnPacket(client, maxspawns);
|
||||
|
||||
int32 race=-1;
|
||||
for (auto it = mob_list.begin(); it != mob_list.end(); ++it) {
|
||||
spawn = it->second;
|
||||
if (spawn && spawn->InZone()) {
|
||||
if (spawn->IsClient() && (spawn->CastToClient()->GMHideMe(client) ||
|
||||
spawn->CastToClient()->IsHoveringForRespawn()))
|
||||
continue;
|
||||
memset(&ns, 0, sizeof(NewSpawn_Struct));
|
||||
spawn->FillSpawnStruct(&ns, client);
|
||||
bzsp->AddSpawn(&ns);
|
||||
|
||||
race = spawn->GetRace();
|
||||
|
||||
// Illusion races on PCs don't work as a mass spawn
|
||||
// But they will work as an add_spawn AFTER CLIENT_CONNECTED.
|
||||
if (spawn->IsClient() && (race == MINOR_ILL_OBJ || race == TREE)) {
|
||||
app = new EQApplicationPacket;
|
||||
spawn->CreateSpawnPacket(app);
|
||||
client->QueuePacket(app, true, Client::CLIENT_CONNECTED);
|
||||
safe_delete(app);
|
||||
}
|
||||
else {
|
||||
memset(&ns, 0, sizeof(NewSpawn_Struct));
|
||||
spawn->FillSpawnStruct(&ns, client);
|
||||
bzsp->AddSpawn(&ns);
|
||||
}
|
||||
|
||||
// On NPCs wearing gear from loottable or previously traded
|
||||
// to them, mass spawn does not properly update the visual look.
|
||||
// (Bulk packet sends the same info - client just doesn't use it.
|
||||
// except on primary/secondary - tested on multiple client types)
|
||||
// Do that using a Wear Change now.
|
||||
if (!spawn->IsClient()) {
|
||||
const Item_Struct *item;
|
||||
for (int i=0; i< 7 ; ++i) {
|
||||
item=database.GetItem(spawn->GetEquipment(i));
|
||||
if (item != 0) {
|
||||
spawn->SendWearChange(i,client);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
safe_delete(bzsp);
|
||||
|
||||
Reference in New Issue
Block a user