mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-09 22:20:24 +00:00
[Expeditions] Cleanup client dz safe return methods (#1300)
This changes Zone::GetDynamicZone to return a pointer instead of a copy and also lets DynamicZone be forward declared in zone.h
This commit is contained in:
+4
-4
@@ -2729,20 +2729,20 @@ bool Zone::IsZone(uint32 zone_id, uint16 instance_id) const
|
||||
return (zoneid == zone_id && instanceid == instance_id);
|
||||
}
|
||||
|
||||
DynamicZone Zone::GetDynamicZone()
|
||||
DynamicZone* Zone::GetDynamicZone()
|
||||
{
|
||||
if (GetInstanceID() == 0)
|
||||
{
|
||||
return {}; // invalid
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto expedition = Expedition::FindCachedExpeditionByZoneInstance(GetZoneID(), GetInstanceID());
|
||||
if (expedition)
|
||||
{
|
||||
return expedition->GetDynamicZone();
|
||||
return &expedition->GetDynamicZone();
|
||||
}
|
||||
|
||||
// todo: tasks, missions, and quests with an associated dz for this instance id
|
||||
|
||||
return {}; // invalid
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user