mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-18 19:41:30 +00:00
[Commands] Cleanup #bind Command. (#1829)
- Add message and cleanup logic.
This commit is contained in:
parent
b29f398239
commit
514029a6bb
@ -2,16 +2,55 @@
|
|||||||
|
|
||||||
void command_bind(Client *c, const Seperator *sep)
|
void command_bind(Client *c, const Seperator *sep)
|
||||||
{
|
{
|
||||||
if (c->GetTarget() != 0) {
|
Client *target = c;
|
||||||
if (c->GetTarget()->IsClient()) {
|
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
||||||
c->GetTarget()->CastToClient()->SetBindPoint();
|
target = c->GetTarget()->CastToClient();
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
c->Message(Chat::White, "Error: target not a Player");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
c->SetBindPoint();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
target->SetBindPoint();
|
||||||
|
|
||||||
|
bool in_persistent_instance = (
|
||||||
|
zone->GetInstanceID() != 0 &&
|
||||||
|
zone->IsInstancePersistent()
|
||||||
|
);
|
||||||
|
|
||||||
|
auto target_string = (
|
||||||
|
c == target ?
|
||||||
|
"Yourself" :
|
||||||
|
fmt::format(
|
||||||
|
"{} ({})",
|
||||||
|
target->GetCleanName(),
|
||||||
|
target->GetID()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
c->Message(
|
||||||
|
Chat::White,
|
||||||
|
fmt::format(
|
||||||
|
"Set Bind Point for {} | Zone: {} ({}) ID: {} {}",
|
||||||
|
target_string,
|
||||||
|
zone->GetLongName(),
|
||||||
|
zone->GetShortName(),
|
||||||
|
zone->GetZoneID(),
|
||||||
|
(
|
||||||
|
in_persistent_instance ?
|
||||||
|
fmt::format(
|
||||||
|
" Instance ID: {}",
|
||||||
|
zone->GetInstanceID()
|
||||||
|
) :
|
||||||
|
""
|
||||||
|
)
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
|
||||||
|
c->Message(
|
||||||
|
Chat::White,
|
||||||
|
fmt::format(
|
||||||
|
"Set Bind Point for {} | XYZ: {:.2f}, {:.2f}, {:.2f}",
|
||||||
|
target_string,
|
||||||
|
target->GetX(),
|
||||||
|
target->GetY(),
|
||||||
|
target->GetZ()
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user