From ba66fbeda8ef9afb6c33eba66d109bac85ebf628 Mon Sep 17 00:00:00 2001 From: Erik Schilling Date: Tue, 13 Mar 2012 19:05:03 +0100 Subject: Added get_character_by_name lua bind Step to be able to handle chatcommands by scripts. Reviewed-by: bjorn. --- src/game-server/command.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/game-server/command.cpp') diff --git a/src/game-server/command.cpp b/src/game-server/command.cpp index dc824b2..5e87f9f 100644 --- a/src/game-server/command.cpp +++ b/src/game-server/command.cpp @@ -356,7 +356,7 @@ void runCommand(Character *ch, const std::string &text) } else { - GameClient *c = gameHandler->getClientByNameSlow(arg); + Character *c = gameHandler->getCharacterByNameSlow(arg); if (!c) { /* TODO: forward command to other game servers through @@ -364,13 +364,7 @@ void runCommand(Character *ch, const std::string &text) say(ch, "Player " + arg + " was not found"); return; } - if (c->status != CLIENT_CONNECTED) - { - // No suitable character. - say(ch, "Player " + arg + " is offline"); - return; - } - args[i] = (intptr_t)c->character; + args[i] = (intptr_t)c; } break; -- cgit