[Dynamic Zones] Implement dz switch id (#2343)

This adds the `dz_switch_id` field to doors and dynamic_zones. It will
allow for compasses to be automatically added to dz entrances and will
support moving clients to the dz on use without needing to script it.
These can be imported for switches/doors from live packet dumps.

Also removes compass packet encoders (same struct in all clients)
This commit is contained in:
hg
2022-07-30 22:00:11 -04:00
committed by GitHub
parent 1351f147f4
commit 676467cbdc
42 changed files with 349 additions and 235 deletions
+10 -1
View File
@@ -67,6 +67,7 @@ Doors::Doors(const DoorsRepository::Doors& door) :
invert_state = door.invert_state;
destination_instance_id = door.dest_instance;
is_ldon_door = door.is_ldon_door;
m_dz_switch_id = door.dz_switch_id;
client_version_mask = door.client_version_mask;
SetOpenState(false);
@@ -207,7 +208,15 @@ void Doors::HandleClick(Client* sender, uint8 trigger) {
}
}
// todo: if IsDzDoor() call Client::MovePCDynamicZone(target_zone_id) (for systems that use dzs)
if (m_dz_switch_id != 0)
{
// todo: update task touch task events with matching dz switch id
if (sender->TryMovePCDynamicZoneSwitch(m_dz_switch_id))
{
safe_delete(outapp);
return;
}
}
uint32 required_key_item = GetKeyItem();
uint8 disable_add_to_key_ring = GetNoKeyring();