From d926241b94baa93138ecbb73619bd3a3920493ee Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Thu, 29 May 2008 16:50:34 +0000 Subject: Fixed execution of commands even if the user has insufficient rights (patch by rodge). --- src/game-server/command.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/game-server/command.cpp') diff --git a/src/game-server/command.cpp b/src/game-server/command.cpp index 836be6a..4c9ae11 100644 --- a/src/game-server/command.cpp +++ b/src/game-server/command.cpp @@ -204,7 +204,7 @@ static void spawn(Character *from, MonsterClass *specy, int nb) { MapComposite *map = from->getMap(); Point const &pos = from->getPosition(); - + for (int i = 0; i < nb; ++i) { Being *monster = new Monster(specy); @@ -315,6 +315,7 @@ void runCommand(Character *ch, std::string const &text) if (c->level > ch->getAccountLevel()) { say(ch, "You have insufficient rights to perform the " + s + " command"); + return; } intptr_t args[4]; @@ -395,7 +396,7 @@ void runCommand(Character *ch, std::string const &text) say(ch, "Map " + arg + " was not found"); return; } - break; + break; case 'n': args[i] = atoi(arg.c_str()); @@ -417,7 +418,7 @@ void runCommand(Character *ch, std::string const &text) case 's': args[i] = (intptr_t)new std::string(arg); break; - + } pos = pos2; } -- cgit