Ticket #1089: global.diff
File global.diff, 1.7 KB (added by , 9 years ago) |
---|
-
binaries/data/mods/public/simulation/components/AIInterface.js
20 20 "TributeExchanged" 21 21 ]; 22 22 23 var g_changedEntities = {}; 24 23 25 AIInterface.prototype.Init = function() 24 26 { 25 27 this.events = {}; … … 26 28 for each (var i in this.EventNames) 27 29 this.events[i] = []; 28 30 29 this.changedEntities = {};30 31 31 // cache for technology changes; 32 32 // this one is PlayerID->TemplateName->{StringForTheValue, ActualValue} 33 33 this.changedTemplateInfo = {}; … … 61 61 // Add entity representations 62 62 Engine.ProfileStart("proxy representations"); 63 63 state.entities = {}; 64 for (var id in this.changedEntities)64 for (var id in g_changedEntities) 65 65 { 66 66 var aiProxy = Engine.QueryInterface(+id, IID_AIProxy); 67 67 if (aiProxy) 68 68 state.entities[id] = aiProxy.GetRepresentation(); 69 69 } 70 this.changedEntities = {};70 g_changedEntities = {}; 71 71 Engine.ProfileStop(); 72 72 73 73 state.changedTemplateInfo = this.changedTemplateInfo; … … 91 91 Engine.ProfileStart("proxy representations"); 92 92 state.entities = {}; 93 93 // all entities are changed in the initial state. 94 for (var id in this.changedEntities)94 for (var id in g_changedEntities) 95 95 { 96 96 var aiProxy = Engine.QueryInterface(+id, IID_AIProxy); 97 97 if (aiProxy) … … 109 109 110 110 AIInterface.prototype.ChangedEntity = function(ent) 111 111 { 112 this.changedEntities[ent] = 1;112 g_changedEntities[ent] = 1; 113 113 }; 114 114 115 115 // AIProxy sets up a load of event handlers to capture interesting things going on