Merge pull request #7507 from delftswa2014/bugfix/cheatfix

Fixed all cheat code
This commit is contained in:
Oliver Brakmann
2015-02-22 15:10:17 +01:00
2 changed files with 35 additions and 8 deletions

View File

@@ -43,6 +43,7 @@ namespace OpenRA.Traits
public bool ShowCombatGeometry;
public bool ShowDebugGeometry;
public bool ShowTerrainGeometry;
public bool EnableAll;
public DeveloperMode(DeveloperModeInfo info)
{
@@ -65,6 +66,39 @@ namespace OpenRA.Traits
switch (order.OrderString)
{
case "DevAll":
{
if (!EnableAll)
{
AllTech = true;
FastCharge = true;
FastBuild = true;
DisableShroud = true;
self.Owner.Shroud.ExploreAll(self.World);
UnlimitedPower = true;
BuildAnywhere = true;
var amount = order.ExtraData != 0 ? (int)order.ExtraData : info.Cash;
self.Trait<PlayerResources>().GiveCash(amount);
EnableAll = true;
}
else
{
AllTech = false;
FastCharge = false;
FastBuild = false;
DisableShroud = false;
self.Owner.Shroud.ResetExploration();
UnlimitedPower = false;
BuildAnywhere = false;
EnableAll = false;
}
break;
}
case "DevEnableTech":
{
AllTech ^= true;

View File

@@ -80,14 +80,7 @@ namespace OpenRA.Mods.Common.Commands
case "instantcharge": IssueDevCommand(world, "DevFastCharge"); break;
case "all":
IssueDevCommand(world, "DevShroudDisable");
IssueDevCommand(world, "DevFastBuild");
IssueDevCommand(world, "DevBuildAnywhere");
IssueDevCommand(world, "DevUnlimitedPower");
IssueDevCommand(world, "DevEnableTech");
IssueDevCommand(world, "DevFastCharge");
IssueDevCommand(world, "DevGiveCash");
IssueDevCommand(world, "DevLevelUp");
IssueDevCommand(world, "DevAll");
break;
case "crash":