mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-22 09:45:03 +00:00
Prohibit cheats if cheats are disabled,
i.e. developer cheats to control enemy units, revealing the map and promoting units too. Open the developer overlay only if cheats are enabled (which is always the case in singleplayer mode and only the case in multiplayer mode if explicitly enabled). (This doesn't make it harder for developers to "debug", since they previously had to remember to disable the rated game setting too. Also every bug had to be reproduced with the replay either way) Reverts3cbbf31173which reverted6e0e607b20(since as ofc288278229, the autostart gamesetup enables cheats too). Differential Revision: https://code.wildfiregames.com/D455 Fixes #3551 Reviewed By: echotangoecho Agreed with Itms and Imarok in the last staff meeting. This was SVN commit r19558.
This commit is contained in:
@@ -1121,8 +1121,7 @@ function openManual()
|
||||
|
||||
function toggleDeveloperOverlay()
|
||||
{
|
||||
// The developer overlay is disabled in ranked games
|
||||
if (Engine.HasXmppClient() && Engine.IsRankedGame())
|
||||
if (!g_GameAttributes.settings.CheatsEnabled)
|
||||
return;
|
||||
|
||||
let devCommands = Engine.GetGUIObjectByName("devCommands");
|
||||
|
||||
@@ -114,6 +114,9 @@ var g_Commands = {
|
||||
|
||||
"control-all": function(player, cmd, data)
|
||||
{
|
||||
if (!data.cmpPlayer.GetCheatsEnabled())
|
||||
return;
|
||||
|
||||
var cmpGuiInterface = Engine.QueryInterface(SYSTEM_ENTITY, IID_GuiInterface);
|
||||
cmpGuiInterface.PushNotification({
|
||||
"type": "aichat",
|
||||
@@ -126,6 +129,9 @@ var g_Commands = {
|
||||
|
||||
"reveal-map": function(player, cmd, data)
|
||||
{
|
||||
if (!data.cmpPlayer.GetCheatsEnabled())
|
||||
return;
|
||||
|
||||
var cmpGuiInterface = Engine.QueryInterface(SYSTEM_ENTITY, IID_GuiInterface);
|
||||
cmpGuiInterface.PushNotification({
|
||||
"type": "aichat",
|
||||
@@ -563,6 +569,9 @@ var g_Commands = {
|
||||
|
||||
"promote": function(player, cmd, data)
|
||||
{
|
||||
if (!data.cmpPlayer.GetCheatsEnabled())
|
||||
return;
|
||||
|
||||
var cmpGuiInterface = Engine.QueryInterface(SYSTEM_ENTITY, IID_GuiInterface);
|
||||
cmpGuiInterface.PushNotification({
|
||||
"type": "aichat",
|
||||
|
||||
Reference in New Issue
Block a user