[Zoning] Fix zone race condition (#2479)

* Testing

* Separate auto shutdown fix

* Revert for PR

* Invalidate lock in places where zoning is cancelled
This commit is contained in:
Chris Miles
2022-10-11 21:23:27 -04:00
committed by GitHub
parent 18bfee5616
commit bc72641eef
4 changed files with 34 additions and 6 deletions
+6
View File
@@ -394,6 +394,8 @@ void Client::SendZoneCancel(ZoneChange_Struct *zc) {
zone_mode = ZoneUnsolicited;
// reset since we're not zoning anymore
bZoning = false;
// remove save position lock
m_lock_save_position = false;
}
void Client::SendZoneError(ZoneChange_Struct *zc, int8 err)
@@ -413,6 +415,8 @@ void Client::SendZoneError(ZoneChange_Struct *zc, int8 err)
zone_mode = ZoneUnsolicited;
// reset since we're not zoning anymore
bZoning = false;
// remove save position lock
m_lock_save_position = false;
}
void Client::DoZoneSuccess(ZoneChange_Struct *zc, uint16 zone_id, uint32 instance_id, float dest_x, float dest_y, float dest_z, float dest_h, int8 ignore_r) {
@@ -467,6 +471,8 @@ void Client::DoZoneSuccess(ZoneChange_Struct *zc, uint16 zone_id, uint32 instanc
//Force a save so its waiting for them when they zone
Save(2);
m_lock_save_position = true;
if (zone_id == zone->GetZoneID() && instance_id == zone->GetInstanceID()) {
// No need to ask worldserver if we're zoning to ourselves (most
// likely to a bind point), also fixes a bug since the default response was failure