Ticket #2180: AIFix_.2.patch
File AIFix_.2.patch, 4.2 KB (added by , 10 years ago) |
---|
-
binaries/data/mods/public/simulation/ai/aegis/base-manager.js
483 483 // for each dropsite, recalculate 484 484 for (i in this.dropsites) 485 485 { 486 warn(uneval(i)); 486 487 for (type in this.dropsites[i]) 487 488 { 488 489 this.updateDropsite(gameState,gameState.getEntityById(i),type); -
binaries/data/mods/public/simulation/ai/common-api-v3/shared.js
214 214 // applies entity deltas, and each gamestate. 215 215 SharedScript.prototype.onUpdate = function(state) 216 216 { 217 if (this.turn !== 0) 218 this.ApplyEntitiesDelta(state); 217 this.ApplyEntitiesDelta(state); 219 218 220 219 Engine.ProfileStart("onUpdate"); 221 220 … … 297 296 for (var i in this._players) 298 297 delete this._entityMetadata[this._players[i]][evt.msg.entity]; 299 298 } 299 else if (evt.type == "EntityRenamed") 300 { 301 //combines destroy and create. 302 303 warn(uneval(evt.msg)); 304 if (!state.entities[evt.msg.newentity]) 305 continue; 306 307 warn("first check"); 308 this._entities[evt.msg.newentity] = new Entity(this, state.entities[evt.msg.newentity]); 309 this.entities.addEnt(this._entities[evt.msg.newentity]); 310 311 // Update all the entity collections since the create operation affects static properties as well as dynamic 312 for (var entCollection in this._entityCollections) 313 this._entityCollections[entCollection].updateEnt(this._entities[evt.msg.newentity]); 314 315 if (!this._entities[evt.msg.entity]) 316 continue; 317 318 warn("second check"); 319 // Dunno if this is relevant on renaming. 320 if (foundationFinished[evt.msg.entity]) 321 evt.msg["SuccessfulFoundation"] = true; 322 323 // Switch the metadata 324 for (var i in this._players) 325 this._entityMetadata[this._players[i]][evt.msg.entity] = this._entityMetadata[this._players[i]][evt.msg.entity]; 326 327 for each (var entCol in this._entityCollections) 328 entCol.removeEnt(this._entities[evt.msg.entity]); 329 this.entities.removeEnt(this._entities[evt.msg.entity]); 330 } 300 331 else if (evt.type == "TrainingFinished") 301 332 { 302 333 // Apply metadata stored in training queues -
binaries/data/mods/public/simulation/components/AIInterface.js
81 81 this.events.push({"type": "PlayerDefeated", "msg": msg}); 82 82 }; 83 83 84 AIInterface.prototype.OnGlobalEntityRenamed = function(msg) 85 { 86 this.events.push({"type": "EntityRenamed", "msg": msg}); 87 }; 88 84 89 Engine.RegisterComponentType(IID_AIInterface, "AIInterface", AIInterface); -
binaries/data/mods/public/simulation/components/SkirmishReplacer.js
55 55 var cmpReplacementOwnership = Engine.QueryInterface(replacement, IID_Ownership); 56 56 cmpReplacementOwnership.SetOwner(cmpCurOwnership.GetOwner()); 57 57 58 Engine.BroadcastMessage(MT_EntityRenamed, { entity: this.entity, newentity: replacement}); 58 59 Engine.DestroyEntity(this.entity); 59 60 }; 60 61 -
binaries/data/mods/public/simulation/templates/skirmish/structures/default_civil_centre.xml
3 3 <Identity> 4 4 <Civ>skirm</Civ> 5 5 </Identity> 6 <ResourceDropsite disable=""/> 6 7 <SkirmishReplacer> 7 8 <general>structures/{civ}_civil_centre</general> 8 9 </SkirmishReplacer>