mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 05:21:29 +00:00
Range-based for for world/zonelist.cpp
This commit is contained in:
parent
4fde4bba72
commit
4808dcadcf
@ -246,16 +246,16 @@ ZoneServer* ZSList::FindByInstanceID(uint32 InstanceID)
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool ZSList::SetLockedZone(uint16 iZoneID, bool iLock) {
|
bool ZSList::SetLockedZone(uint16 iZoneID, bool iLock) {
|
||||||
for (int i=0; i<MaxLockedZones; i++) {
|
for (auto &zone : pLockedZones) {
|
||||||
if (iLock) {
|
if (iLock) {
|
||||||
if (pLockedZones[i] == 0) {
|
if (zone == 0) {
|
||||||
pLockedZones[i] = iZoneID;
|
zone = iZoneID;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (pLockedZones[i] == iZoneID) {
|
if (zone == iZoneID) {
|
||||||
pLockedZones[i] = 0;
|
zone = 0;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -264,8 +264,8 @@ bool ZSList::SetLockedZone(uint16 iZoneID, bool iLock) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool ZSList::IsZoneLocked(uint16 iZoneID) {
|
bool ZSList::IsZoneLocked(uint16 iZoneID) {
|
||||||
for (int i=0; i<MaxLockedZones; i++) {
|
for (auto &zone : pLockedZones) {
|
||||||
if (pLockedZones[i] == iZoneID)
|
if (zone == iZoneID)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -273,9 +273,9 @@ bool ZSList::IsZoneLocked(uint16 iZoneID) {
|
|||||||
|
|
||||||
void ZSList::ListLockedZones(const char* to, WorldTCPConnection* connection) {
|
void ZSList::ListLockedZones(const char* to, WorldTCPConnection* connection) {
|
||||||
int x = 0;
|
int x = 0;
|
||||||
for (int i=0; i<MaxLockedZones; i++) {
|
for (auto &zone : pLockedZones) {
|
||||||
if (pLockedZones[i]) {
|
if (zone) {
|
||||||
connection->SendEmoteMessageRaw(to, 0, 0, 0, database.GetZoneName(pLockedZones[i], true));
|
connection->SendEmoteMessageRaw(to, 0, 0, 0, database.GetZoneName(zone, true));
|
||||||
x++;
|
x++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user