Ticket #4870: ticket4870.patch
File ticket4870.patch, 3.1 KB (added by , 6 years ago) |
---|
-
binaries/data/mods/public/maps/random/rmgen/player.js
7 7 */ 8 8 function getStartingEntities(playerID) 9 9 { 10 return g_CivData [getCivCode(playerID)].StartEntities;10 return g_CivData.brit.StartEntities; 11 11 } 12 12 13 13 /** -
binaries/data/mods/public/simulation/ai/common-api/gamestate.js
810 810 */ 811 811 m.GameState.prototype.findBuilder = function(template) 812 812 { 813 let civ = this.getPlayerCiv(); 813 814 for (let ent of this.getOwnUnits().values()) 814 815 { 815 let buildable = ent.buildableEntities( );816 let buildable = ent.buildableEntities(civ); 816 817 if (buildable && buildable.indexOf(template) !== -1) 817 818 return ent; 818 819 } -
binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
38 38 { 39 39 Engine.ProfileStart("Building construction start"); 40 40 41 // We don't care which builder we assign, since they won't actually 42 // do the building themselves - all we care about is that there is43 // at least one unit that can start the foundation41 // We don't care which builder we assign, since they won't actually do 42 // the building themselves - all we care about is that there is at least 43 // one unit that can start the foundation (should always be the case here). 44 44 let builder = gameState.findBuilder(this.type); 45 if (!builder) 46 { 47 API3.warn("petra error: builder not found when starting construction."); 48 Engine.ProfileStop(); 49 return; 50 } 45 51 46 52 let pos = this.findGoodPosition(gameState); 47 53 if (!pos) -
binaries/data/mods/public/simulation/components/Builder.js
27 27 Builder.prototype.GetEntitiesList = function() 28 28 { 29 29 let string = this.template.Entities._string; 30 31 30 if (!string) 32 31 return []; 33 32 34 let cmpIdentity = Engine.QueryInterface(this.entity, IID_Identity);35 if (cmpIdentity)36 string = string.replace(/\{civ\}/g, cmpIdentity.GetCiv());37 38 let entities = string.split(/\s+/);39 40 33 let cmpPlayer = QueryOwnerInterface(this.entity); 41 34 if (!cmpPlayer) 42 return entities;35 return []; 43 36 37 let entities = string.replace(/\{civ\}/g, cmpPlayer.GetCiv()).split(/\s+/); 38 44 39 let disabledTemplates = cmpPlayer.GetDisabledTemplates(); 45 40 46 41 let cmpTemplateManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_TemplateManager);