mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 21:01:29 +00:00
* [Commands] Cleanup #gassign Command. - Cleanup messages and logic. * Update gassign.cpp * Update gassign.cpp
24 lines
542 B
C++
Executable File
24 lines
542 B
C++
Executable File
#include "../client.h"
|
|
|
|
void command_gassign(Client *c, const Seperator *sep)
|
|
{
|
|
if (!c->GetTarget() || !c->GetTarget()->IsNPC()) {
|
|
c->Message(Chat::White, "You must target an NPC to use this command.");
|
|
return;
|
|
}
|
|
|
|
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());
|
|
}
|
|
}
|
|
|