Ticket #3545: 3545.diff
File 3545.diff, 1.0 KB (added by , 9 years ago) |
---|
-
binaries/data/mods/public/simulation/helpers/Cheat.js
1 /** 2 * This function uses the cheat data input to perform different actions 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 } 79 // We want to prevent spawning too many units at once cause it might crash the game. 80 if (input.parameter > 500) 81 return; 82 75 83 for (let i = 0; i < input.parameter; ++i) 76 84 cmpProductionQueue.SpawnUnits(input.templates[i % input.templates.length], 1, null); 77 85 break;