Temporary fix for #3551 in the interest of having a fair A19. Prohibit deverloper overlay cheats when cheats are disabled. Patch by elexis. Refs #3551

This was SVN commit r17282.
This commit is contained in:
wraitii 2015-11-19 17:27:27 +00:00
parent 9e35f7d68b
commit 6e0e607b20
2 changed files with 11 additions and 3 deletions

View file

@ -683,8 +683,8 @@ function openManual()
function toggleDeveloperOverlay()
{
// The developer overlay is disabled in ranked games
if (Engine.HasXmppClient() && Engine.IsRankedGame())
// The developer overlay is disabled when cheats are disabled
if (g_IsObserver || !g_SimState.players[Engine.GetPlayerID()].cheatsEnabled)
return;
var devCommands = Engine.GetGUIObjectByName("devCommands");

View file

@ -100,11 +100,17 @@ var g_Commands = {
"control-all": function(player, cmd, data)
{
if (!data.cmpPlayer.GetCheatsEnabled())
return;
data.cmpPlayer.SetControlAllUnits(cmd.flag);
},
"reveal-map": function(player, cmd, data)
{
if (!data.cmpPlayer.GetCheatsEnabled())
return;
// Reveal the map for all players, not just the current player,
// primarily to make it obvious to everyone that the player is cheating
var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager);
@ -554,7 +560,9 @@ var g_Commands = {
"promote": function(player, cmd, data)
{
// No need to do checks here since this is a cheat anyway
if (!data.cmpPlayer.GetCheatsEnabled())
return;
var cmpGuiInterface = Engine.QueryInterface(SYSTEM_ENTITY, IID_GuiInterface);
cmpGuiInterface.PushNotification({"type": "chat", "players": [player], "message": "(Cheat - promoted units)"});