From 02c7b180948a8729b6d8146cf808e69fd5cff0c7 Mon Sep 17 00:00:00 2001 From: Scionwest_cp Date: Sun, 18 Apr 2010 11:32:49 -0700 Subject: [PATCH] Mud Engine: GMTeleport checks to make sure the player using the command is indeed a GM. --- .../MudEngine/GameCommands/CommandGMTeleport.cs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Mud Designer/MudEngine/GameCommands/CommandGMTeleport.cs b/Mud Designer/MudEngine/GameCommands/CommandGMTeleport.cs index 072a0a3..b86e867 100644 --- a/Mud Designer/MudEngine/GameCommands/CommandGMTeleport.cs +++ b/Mud Designer/MudEngine/GameCommands/CommandGMTeleport.cs @@ -24,14 +24,12 @@ namespace MudDesigner.MudEngine.GameCommands public CommandResults Execute(BaseCharacter player, ProjectInformation project, Room room, string command) { PlayerGM playerGM = new PlayerGM(); - bool foundGM = false; - - if (player is PlayerGM) - { - foundGM = true; - } - if (!foundGM) + if (player is PlayerGM) + { + playerGM = (PlayerGM)player; + } + else return null; //TODO: Find the Realm/Zone/Room that the GM specified to teleport to.