Ticket #3551: t3551_prohibit_all_cheats_when_cheats_are_disabled_v2.patch
File t3551_prohibit_all_cheats_when_cheats_are_disabled_v2.patch, 1.6 KB (added by , 8 years ago) |
---|
-
binaries/data/mods/public/simulation/helpers/Commands.js
var commands = { 98 98 data.cmpPlayer.TributeResource(cmd.player, cmd.amounts); 99 99 }, 100 100 101 101 "control-all": function(player, cmd, data) 102 102 { 103 var cmpPlayer = Engine.QueryInterface(data.playerEnt, IID_Player); 104 if (!cmpPlayer.GetCheatsEnabled()) 105 return; 106 103 107 data.cmpPlayer.SetControlAllUnits(cmd.flag); 104 108 }, 105 109 106 110 "reveal-map": function(player, cmd, data) 107 111 { 112 var cmpPlayer = Engine.QueryInterface(data.playerEnt, IID_Player); 113 if (!cmpPlayer.GetCheatsEnabled()) 114 return; 115 108 116 // Reveal the map for all players, not just the current player, 109 117 // primarily to make it obvious to everyone that the player is cheating 110 118 var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager); 111 119 cmpRangeManager.SetLosRevealAll(-1, cmd.enable); 112 120 }, … … var commands = { 552 560 }); 553 561 }, 554 562 555 563 "promote": function(player, cmd, data) 556 564 { 557 // No need to do checks here since this is a cheat anyway 565 var cmpPlayer = Engine.QueryInterface(data.playerEnt, IID_Player); 566 if (!cmpPlayer.GetCheatsEnabled()) 567 return; 568 558 569 var cmpGuiInterface = Engine.QueryInterface(SYSTEM_ENTITY, IID_GuiInterface); 559 570 cmpGuiInterface.PushNotification({"type": "chat", "players": [player], "message": "(Cheat - promoted units)"}); 560 571 561 572 for each (var ent in cmd.entities) 562 573 {