comments, allow invited users 2 enter locked areas

This commit is contained in:
in1tiate 2021-02-28 10:49:40 -06:00
parent fcca15a785
commit 7f615df8c5
2 changed files with 4 additions and 4 deletions

View File

@ -103,7 +103,7 @@ void AOClient::changeArea(int new_area)
sendServerMessage("You are already in area " + server->area_names[current_area]);
return;
}
if (server->areas[new_area]->locked == AreaData::LockStatus::LOCKED) {
if (server->areas[new_area]->locked == AreaData::LockStatus::LOCKED && !server->areas[new_area]->invited.contains(id)) {
sendServerMessage("Area " + server->area_names[new_area] + " is locked.");
return;
}

View File

@ -512,7 +512,7 @@ void AOClient::cmdLock(int argc, QStringList argv)
sendServerMessage("This area is already locked.");
return;
}
sendServerMessage("This area is now locked.");
sendServerMessage("This area is now locked."); // broadcast me!
area->locked = AreaData::LockStatus::LOCKED;
for (AOClient* client : server->clients) {
if (client->current_area == current_area && client->joined) {
@ -532,7 +532,7 @@ void AOClient::cmdSpectatable(int argc, QStringList argv)
sendServerMessage("This area is already in spectate mode.");
return;
}
sendServerMessage("This area is now spectatable.");
sendServerMessage("This area is now spectatable."); // broadcast me!
area->locked = AreaData::LockStatus::SPECTATABLE;
for (AOClient* client : server->clients) {
if (client->current_area == current_area && client->joined) {
@ -552,7 +552,7 @@ void AOClient::cmdUnLock(int argc, QStringList argv)
sendServerMessage("This area is not locked.");
return;
}
sendServerMessage("This area is now unlocked.");
sendServerMessage("This area is now unlocked."); // broadcast me!
area->locked = AreaData::LockStatus::FREE;
arup(ARUPType::LOCKED, true);
}