mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
[Zones] Convert IDLE_WHEN_EMPTY to a Zone Column (#3891)
* [Rules] Convert IDLE_WHEN_EMPTY to a rule # Notes - Converts `IDLE_WHEN_EMPTY` to `Zone:ZonesIdleWhenEmpty` so that we can change this on the fly or on a zone-by-zone basis instead of having to recompile to do this. - Especially helpful for those using release binaries that do not compile their own source. * Convert to zone column. * Update ruletypes.h * Update ruletypes.h * Update entity.cpp * Update entity.cpp * Rename. * Update database_update_manifest.cpp * Update base_zone_repository.h * Update zone.cpp * seconds_before_idle * Update database_update_manifest.cpp * Getter/Setters/Private * Update base_zone_repository.h * IsIdle()/SetIsIdle() * Update entity.cpp
This commit is contained in:
@@ -1341,3 +1341,37 @@ int ZoneStore::GetZoneMinimumLavaDamage(uint32 zone_id, int version)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint8 ZoneStore::GetZoneIdleWhenEmpty(uint32 zone_id, int version)
|
||||
{
|
||||
for (auto &z: m_zones) {
|
||||
if (z.zoneidnumber == zone_id && z.version == version) {
|
||||
return z.idle_when_empty;
|
||||
}
|
||||
}
|
||||
|
||||
for (auto &z: m_zones) {
|
||||
if (z.zoneidnumber == zone_id && z.version == 0) {
|
||||
return z.idle_when_empty;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
uint32 ZoneStore::GetZoneSecondsBeforeIdle(uint32 zone_id, int version)
|
||||
{
|
||||
for (auto &z: m_zones) {
|
||||
if (z.zoneidnumber == zone_id && z.version == version) {
|
||||
return z.seconds_before_idle;
|
||||
}
|
||||
}
|
||||
|
||||
for (auto &z: m_zones) {
|
||||
if (z.zoneidnumber == zone_id && z.version == 0) {
|
||||
return z.seconds_before_idle;
|
||||
}
|
||||
}
|
||||
|
||||
return 60;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user