mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-31 04:56:20 +00:00
[Commands] Cleanup #gassign Command. (#2101)
* [Commands] Cleanup #gassign Command. - Cleanup messages and logic. * Update gassign.cpp * Update gassign.cpp
This commit is contained in:
@@ -2,13 +2,22 @@
|
||||
|
||||
void command_gassign(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (sep->IsNumber(1) && c->GetTarget() && c->GetTarget()->IsNPC() &&
|
||||
c->GetTarget()->CastToNPC()->GetSpawnPointID() > 0) {
|
||||
int spawn2id = c->GetTarget()->CastToNPC()->GetSpawnPointID();
|
||||
database.AssignGrid(c, atoi(sep->arg[1]), spawn2id);
|
||||
if (!c->GetTarget() || !c->GetTarget()->IsNPC()) {
|
||||
c->Message(Chat::White, "You must target an NPC to use this command.");
|
||||
return;
|
||||
}
|
||||
else {
|
||||
c->Message(Chat::White, "Usage: #gassign [num] - must have an npc target!");
|
||||
|
||||
int arguments = sep->argnum;
|
||||
if (!arguments || !sep->IsNumber(1)) {
|
||||
c->Message(Chat::White, "Usage: #gassign [Grid ID]");
|
||||
return;
|
||||
}
|
||||
|
||||
auto grid_id = std::stoul(sep->arg[1]);
|
||||
|
||||
auto target = c->GetTarget()->CastToNPC();
|
||||
if (target->GetSpawnPointID() > 0) {
|
||||
database.AssignGrid(c, grid_id, target->GetID());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user