Locate devmode code largely in the trait, reduce exploitability.

This commit is contained in:
alzeih
2010-07-26 14:58:23 +12:00
parent 10c7674433
commit 30241ddccc
7 changed files with 85 additions and 74 deletions

View File

@@ -101,7 +101,7 @@ namespace OpenRA.Traits
if (unit == null || ! unit.Traits.Contains<BuildableInfo>())
return 0;
if (self.traits.Get<DeveloperMode>().FastBuild) return 0;
if (Game.LobbyInfo.GlobalSettings.AllowCheats && self.traits.Get<DeveloperMode>().FastBuild) return 0;
var ui = unit.Traits.Get<BuildableInfo>();
var time = ui.Cost
* self.Owner.PlayerActor.Info.Traits.Get<ProductionQueueInfo>().BuildSpeed /* todo: country-specific build speed bonus */