[Fix] Zone Flags Regression (#2760)

This commit is contained in:
Chris Miles 2023-01-19 15:11:32 -06:00 committed by GitHub
parent 29473aa7f5
commit a7b35594f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 7 deletions

View File

@ -1352,7 +1352,7 @@ public:
void ClearPendingAdventureDoorClick() { safe_delete(adventure_door_timer); }
void ClearPendingAdventureData();
bool CanEnterZone(std::string zone_short_name = "", int16 instance_version = -1);
bool CanEnterZone(const std::string& zone_short_name = "", int16 instance_version = -1);
int GetAggroCount();
void IncrementAggroCount(bool raid_target = false);

View File

@ -265,6 +265,19 @@ void Doors::HandleClick(Client *sender, uint8 trigger)
}
}
// enforce flags before they hit zoning process
auto z = GetZone(m_destination_zone_name, 0);
if (!z->flag_needed.empty() && Strings::IsNumber(z->flag_needed) && std::stoi(z->flag_needed) == 1) {
if (sender->Admin() < minStatusToIgnoreZoneFlags && !sender->HasZoneFlag(z->zoneidnumber)) {
LogInfo(
"Character [{}] does not have the flag to be in this zone [{}]!",
sender->GetCleanName(),
z->flag_needed
);
sender->MessageString(Chat::LightBlue, DOORS_LOCKED);
}
}
/**
* Guild Doors
*

View File

@ -1198,7 +1198,7 @@ void Client::SetPEQZoneFlag(uint32 zone_id) {
}
}
bool Client::CanEnterZone(std::string zone_short_name, int16 instance_version) {
bool Client::CanEnterZone(const std::string& zone_short_name, int16 instance_version) {
//check some critial rules to see if this char needs to be booted from the zone
//only enforce rules here which are serious enough to warrant being kicked from
//the zone
@ -1246,11 +1246,8 @@ bool Client::CanEnterZone(std::string zone_short_name, int16 instance_version) {
return false;
}
if (!z->flag_needed.empty()) {
if (
Admin() < minStatusToIgnoreZoneFlags &&
!HasZoneFlag(zone->GetZoneID())
) {
if (!z->flag_needed.empty() && Strings::IsNumber(z->flag_needed) && std::stoi(z->flag_needed) == 1) {
if (Admin() < minStatusToIgnoreZoneFlags && !HasZoneFlag(z->zoneidnumber)) {
LogInfo(
"Character [{}] does not have the flag to be in this zone [{}]!",
GetCleanName(),