diff options
Diffstat (limited to 'src/game-server/commandhandler.cpp')
-rw-r--r-- | src/game-server/commandhandler.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/game-server/commandhandler.cpp b/src/game-server/commandhandler.cpp index 5bd6a04f..1daa6acc 100644 --- a/src/game-server/commandhandler.cpp +++ b/src/game-server/commandhandler.cpp @@ -67,6 +67,7 @@ static void handleTakePermission(Character*, std::string&); static void handleAnnounce(Character*, std::string&); static void handleHistory(Character*, std::string&); static void handleMute(Character*, std::string&); +static void handleDie(Character*, std::string&); static CmdRef const cmdRef[] = { @@ -110,6 +111,8 @@ static CmdRef const cmdRef[] = "Shows the last transactions", &handleHistory}, {"mute","<character> <length in seconds>", "Prevents the character from talking for the specified number of seconds. Use 0 seconds to unmute.", &handleMute}, + {"die", "", + "Kills you.", &handleDie}, {NULL, NULL, NULL, NULL} }; @@ -1033,9 +1036,9 @@ static void handleHistory(Character *player, std::string &args) // TODO: Get args number of transactions and show them to the player } - static void handleMute(Character *player, std::string &args) -{ Character *other; +{ + Character *other; int length; // Get arguments. @@ -1086,6 +1089,12 @@ static void handleMute(Character *player, std::string &args) GameState::sayTo(player, NULL, userMsg.str()); } +static void handleDie(Character *player, std::string &args) +{ + player->setAttribute(ATTR_HP, 0); + GameState::sayTo(player, NULL, "You've killed yourself."); +} + void CommandHandler::handleCommand(Character *player, const std::string &command) { |