mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-31 04:56:20 +00:00
[Commands] Cleanup #wpinfo Command. (#1866)
- Cleanup message and logic. - Only display grid/waypoints if NPC has a grid.
This commit is contained in:
@@ -2,14 +2,25 @@
|
||||
|
||||
void command_wpinfo(Client *c, const Seperator *sep)
|
||||
{
|
||||
Mob *t = c->GetTarget();
|
||||
|
||||
if (t == nullptr || !t->IsNPC()) {
|
||||
c->Message(Chat::White, "You must target an NPC to use this.");
|
||||
if (!c->GetTarget() || !c->GetTarget()->IsNPC()) {
|
||||
c->Message(Chat::White, "You must target an NPC to use this command.");
|
||||
return;
|
||||
}
|
||||
|
||||
NPC *n = t->CastToNPC();
|
||||
n->DisplayWaypointInfo(c);
|
||||
auto target = c->GetTarget()->CastToNPC();
|
||||
|
||||
if (!target->GetGrid()) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} ({}) is not a part of any grid.",
|
||||
target->GetCleanName(),
|
||||
target->GetID()
|
||||
).c_str()
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
target->DisplayWaypointInfo(c);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user