- Timestamp:
- Apr 12, 2021, 8:51:39 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ps/trunk/binaries/data/mods/public/simulation/components/ResourceGatherer.js
r25206 r25235 218 218 ResourceGatherer.prototype.StopGathering = function(reason) 219 219 { 220 if (this.timer) 221 { 222 let cmpTimer = Engine.QueryInterface(SYSTEM_ENTITY, IID_Timer); 223 cmpTimer.CancelTimer(this.timer); 224 delete this.timer; 225 } 226 227 if (this.target) 228 { 229 let cmpResourceSupply = Engine.QueryInterface(this.target, IID_ResourceSupply); 230 if (cmpResourceSupply) 231 cmpResourceSupply.RemoveGatherer(this.entity); 232 this.RemoveFromPlayerCounter(); 233 delete this.target; 234 } 220 if (!this.target) 221 return; 222 223 let cmpTimer = Engine.QueryInterface(SYSTEM_ENTITY, IID_Timer); 224 cmpTimer.CancelTimer(this.timer); 225 delete this.timer; 226 227 let cmpResourceSupply = Engine.QueryInterface(this.target, IID_ResourceSupply); 228 if (cmpResourceSupply) 229 cmpResourceSupply.RemoveGatherer(this.entity); 230 this.RemoveFromPlayerCounter(); 231 232 delete this.target; 235 233 236 234 let cmpVisual = Engine.QueryInterface(this.entity, IID_Visual); … … 238 236 cmpVisual.SelectAnimation("idle", false, 1.0); 239 237 240 // The callerIID component may start gatheringagain,238 // The callerIID component may start again, 241 239 // replacing the callerIID, hence save that. 242 240 let callerIID = this.callerIID;
Note:
See TracChangeset
for help on using the changeset viewer.