mirror of
https://github.com/DarkflameUniverse/DarkflameServer
synced 2024-08-30 18:43:58 +00:00
Fixed an issue where leave-zone was working outside of instanced zones (#431)
This commit is contained in:
parent
13980c4133
commit
f0a4324bd4
@ -304,28 +304,16 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
if ((chatCommand == "leave-zone")) {
|
||||
const auto currentZone = dZoneManager::Instance()->GetZone()->GetZoneID().GetMapID();
|
||||
|
||||
auto newZone = 1100;
|
||||
|
||||
switch (currentZone)
|
||||
{
|
||||
case 1101:
|
||||
newZone = 1100;
|
||||
break;
|
||||
case 1204:
|
||||
newZone = 1200;
|
||||
break;
|
||||
default:
|
||||
newZone = 1100;
|
||||
break;
|
||||
}
|
||||
|
||||
if (currentZone == newZone)
|
||||
{
|
||||
auto newZone = 0;
|
||||
if (currentZone % 100 == 0) {
|
||||
ChatPackets::SendSystemMessage(sysAddr, u"You are not in an instanced zone.");
|
||||
|
||||
return;
|
||||
} else {
|
||||
newZone = (currentZone / 100) * 100;
|
||||
}
|
||||
|
||||
// If new zone would be inaccessible, then default to Avant Gardens.
|
||||
if (!CheckIfAccessibleZone(newZone)) newZone = 1100;
|
||||
|
||||
ChatPackets::SendSystemMessage(sysAddr, u"Leaving zone...");
|
||||
|
||||
const auto objid = entity->GetObjectID();
|
||||
|
Loading…
Reference in New Issue
Block a user