Ticket #3545: 3545.3.diff
File 3545.3.diff, 1.0 KB (added by , 9 years ago) |
---|
-
binaries/data/mods/public/simulation/helpers/Cheat.js
1 /** 2 * This function performs different simulation commands such as adding resources, spawning units 3 * modifying max population etc. 4 */ 1 5 function Cheat(input) 2 6 { 3 7 var cmpPlayerManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_PlayerManager); … … 72 76 cmpGuiInterface.PushNotification({"type": "notification", "players": [input.player], "message": "You need to select a building that trains units."}); 73 77 return; 74 78 } 75 for (let i = 0; i < input.parameter; ++i) 79 80 for (let i = 0; i < Math.Min(input.parameter, cmpPlayer.GetMaxPopulation() - cmpPlayer.GetPopulationCount() + 100); ++i) 76 81 cmpProductionQueue.SpawnUnits(input.templates[i % input.templates.length], 1, null); 77 82 break; 78 83 case "fastactions":