mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 22:01:30 +00:00
[Bug Fix] Fix MovePC in #zone and #zoneinstance Commands. (#2236)
* [Bug Fix] Fix MovePC in #zone and #zoneinstance COmmands. * #zone 0 Optional Functionality.
This commit is contained in:
parent
57ac46d090
commit
38da37755d
@ -8,21 +8,34 @@ void command_zone(Client *c, const Seperator *sep)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string zone_identifier = sep->arg[1];
|
||||||
|
|
||||||
|
if (StringIsNumber(zone_identifier) && zone_identifier == "0") {
|
||||||
|
c->Message(Chat::White, "Sending you to the safe coordinates of this zone.");
|
||||||
|
|
||||||
|
c->MovePC(
|
||||||
|
0.0f,
|
||||||
|
0.0f,
|
||||||
|
0.0f,
|
||||||
|
0.0f,
|
||||||
|
0,
|
||||||
|
ZoneToSafeCoords
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
auto zone_id = (
|
auto zone_id = (
|
||||||
sep->IsNumber(1) ?
|
sep->IsNumber(1) ?
|
||||||
std::stoul(sep->arg[1]) :
|
std::stoul(zone_identifier) :
|
||||||
ZoneID(sep->arg[1])
|
ZoneID(zone_identifier)
|
||||||
);
|
);
|
||||||
auto zone_short_name = ZoneName(zone_id);
|
auto zone_short_name = ZoneName(zone_id);
|
||||||
if (
|
if (!zone_id || !zone_short_name) {
|
||||||
!zone_id ||
|
|
||||||
!zone_short_name
|
|
||||||
) {
|
|
||||||
c->Message(
|
c->Message(
|
||||||
Chat::White,
|
Chat::White,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"No zones were found matching '{}'.",
|
"No zones were found matching '{}'.",
|
||||||
sep->arg[1]
|
zone_identifier
|
||||||
).c_str()
|
).c_str()
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
@ -44,6 +57,7 @@ void command_zone(Client *c, const Seperator *sep)
|
|||||||
auto x = sep->IsNumber(2) ? std::stof(sep->arg[2]) : 0.0f;
|
auto x = sep->IsNumber(2) ? std::stof(sep->arg[2]) : 0.0f;
|
||||||
auto y = sep->IsNumber(3) ? std::stof(sep->arg[3]) : 0.0f;
|
auto y = sep->IsNumber(3) ? std::stof(sep->arg[3]) : 0.0f;
|
||||||
auto z = sep->IsNumber(4) ? std::stof(sep->arg[4]) : 0.0f;
|
auto z = sep->IsNumber(4) ? std::stof(sep->arg[4]) : 0.0f;
|
||||||
|
auto zone_mode = sep->IsNumber(2) ? ZoneSolicited : ZoneToSafeCoords;
|
||||||
|
|
||||||
c->MovePC(
|
c->MovePC(
|
||||||
zone_id,
|
zone_id,
|
||||||
@ -51,6 +65,7 @@ void command_zone(Client *c, const Seperator *sep)
|
|||||||
y,
|
y,
|
||||||
z,
|
z,
|
||||||
0.0f,
|
0.0f,
|
||||||
sep->IsNumber(2) ? 0 : ZoneToSafeCoords
|
0,
|
||||||
|
zone_mode
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -10,7 +10,7 @@ void command_zone_instance(Client *c, const Seperator *sep)
|
|||||||
|
|
||||||
auto instance_id = std::stoul(sep->arg[1]);
|
auto instance_id = std::stoul(sep->arg[1]);
|
||||||
if (!instance_id) {
|
if (!instance_id) {
|
||||||
c->Message(Chat::White, "You must enter a valid instance id.");
|
c->Message(Chat::White, "You must enter a valid Instance ID.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,17 +37,15 @@ void command_zone_instance(Client *c, const Seperator *sep)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (database.CharacterInInstanceGroup(instance_id, c->CharacterID())) {
|
if (!database.CharacterInInstanceGroup(instance_id, c->CharacterID())) {
|
||||||
c->Message(Chat::White, "You are already a part of this instance, sending you there.");
|
database.AddClientToInstance(instance_id, c->CharacterID());
|
||||||
c->MoveZoneInstance(instance_id);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!database.VerifyInstanceAlive(instance_id, c->CharacterID())) {
|
if (!database.VerifyInstanceAlive(instance_id, c->CharacterID())) {
|
||||||
c->Message(
|
c->Message(
|
||||||
Chat::White,
|
Chat::White,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"Instance ID {} expired or you are not apart of this instance.",
|
"Instance ID {} expired.",
|
||||||
instance_id
|
instance_id
|
||||||
).c_str()
|
).c_str()
|
||||||
);
|
);
|
||||||
@ -57,6 +55,7 @@ void command_zone_instance(Client *c, const Seperator *sep)
|
|||||||
auto x = sep->IsNumber(2) ? std::stof(sep->arg[2]) : 0.0f;
|
auto x = sep->IsNumber(2) ? std::stof(sep->arg[2]) : 0.0f;
|
||||||
auto y = sep->IsNumber(3) ? std::stof(sep->arg[3]) : 0.0f;
|
auto y = sep->IsNumber(3) ? std::stof(sep->arg[3]) : 0.0f;
|
||||||
auto z = sep->IsNumber(4) ? std::stof(sep->arg[4]) : 0.0f;
|
auto z = sep->IsNumber(4) ? std::stof(sep->arg[4]) : 0.0f;
|
||||||
|
auto zone_mode = sep->IsNumber(2) ? ZoneSolicited : ZoneToSafeCoords;
|
||||||
|
|
||||||
c->MovePC(
|
c->MovePC(
|
||||||
zone_id,
|
zone_id,
|
||||||
@ -65,6 +64,7 @@ void command_zone_instance(Client *c, const Seperator *sep)
|
|||||||
y,
|
y,
|
||||||
z,
|
z,
|
||||||
0.0f,
|
0.0f,
|
||||||
sep->IsNumber(2) ? 0 : ZoneToSafeCoords
|
0,
|
||||||
|
zone_mode
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user