mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-11 03:31:08 +00:00
Make sure packet stuff is aware of instance_id
This commit is contained in:
+3
-3
@@ -1142,10 +1142,10 @@ struct ServerInstanceUpdateTime_Struct
|
||||
uint32 new_duration;
|
||||
};
|
||||
|
||||
struct ServerSpawnStatusChange_Struct
|
||||
{
|
||||
struct ServerSpawnStatusChange_Struct {
|
||||
uint32 id;
|
||||
bool new_status;
|
||||
bool new_status;
|
||||
uint32 instance_id;
|
||||
};
|
||||
|
||||
struct ServerQGlobalUpdate_Struct
|
||||
|
||||
+7
-4
@@ -362,8 +362,9 @@ void QuestManager::enable_spawn2(uint32 spawn2_id)
|
||||
database.UpdateSpawn2Status(spawn2_id, 1, zone->GetInstanceID());
|
||||
auto pack = new ServerPacket(ServerOP_SpawnStatusChange, sizeof(ServerSpawnStatusChange_Struct));
|
||||
auto *ssc = (ServerSpawnStatusChange_Struct *) pack->pBuffer;
|
||||
ssc->id = spawn2_id;
|
||||
ssc->new_status = true;
|
||||
ssc->id = spawn2_id;
|
||||
ssc->new_status = true;
|
||||
scc->instance_id = zone->GetInstanceID();
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
}
|
||||
@@ -373,8 +374,10 @@ void QuestManager::disable_spawn2(uint32 spawn2_id)
|
||||
database.UpdateSpawn2Status(spawn2_id, 0, zone->GetInstanceID());
|
||||
auto pack = new ServerPacket(ServerOP_SpawnStatusChange, sizeof(ServerSpawnStatusChange_Struct));
|
||||
auto *ssc = (ServerSpawnStatusChange_Struct *) pack->pBuffer;
|
||||
ssc->id = spawn2_id;
|
||||
ssc->new_status = false;
|
||||
ssc->id = spawn2_id;
|
||||
ssc->new_status = false;
|
||||
scc->instance_id = zone->GetInstanceID();
|
||||
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
}
|
||||
|
||||
+11
-12
@@ -1729,28 +1729,27 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
if (zone)
|
||||
{
|
||||
ServerSpawnStatusChange_Struct *ssc = (ServerSpawnStatusChange_Struct*)pack->pBuffer;
|
||||
LinkedListIterator<Spawn2*> iterator(zone->spawn2_list);
|
||||
if (ssc->instance_id != zone->GetInstanceID()) {
|
||||
break;
|
||||
}
|
||||
|
||||
LinkedListIterator<Spawn2 *> iterator(zone->spawn2_list);
|
||||
iterator.Reset();
|
||||
Spawn2 *found_spawn = nullptr;
|
||||
while (iterator.MoreElements())
|
||||
{
|
||||
Spawn2* cur = iterator.GetData();
|
||||
if (cur->GetID() == ssc->id)
|
||||
{
|
||||
while (iterator.MoreElements()) {
|
||||
Spawn2 *cur = iterator.GetData();
|
||||
if (cur->GetID() == ssc->id) {
|
||||
found_spawn = cur;
|
||||
break;
|
||||
}
|
||||
iterator.Advance();
|
||||
}
|
||||
|
||||
if (found_spawn)
|
||||
{
|
||||
if (ssc->new_status == 0)
|
||||
{
|
||||
if (found_spawn) {
|
||||
if (ssc->new_status == 0) {
|
||||
found_spawn->Disable();
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
found_spawn->Enable();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user