- 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/Heal.js
r25207 r25235 167 167 168 168 /** 169 * @param {string} reason - The reason why we stopped healing. Currently implemented are: 170 * "outOfRange", "targetInvalidated". 169 * @param {string} reason - The reason why we stopped healing. 171 170 */ 172 171 Heal.prototype.StopHealing = function(reason) 173 172 { 174 if (this.timer) 175 { 176 let cmpTimer = Engine.QueryInterface(SYSTEM_ENTITY, IID_Timer); 177 cmpTimer.CancelTimer(this.timer); 178 delete this.timer; 179 } 173 if (!this.target) 174 return; 175 176 let cmpTimer = Engine.QueryInterface(SYSTEM_ENTITY, IID_Timer); 177 cmpTimer.CancelTimer(this.timer); 178 delete this.timer; 179 180 delete this.target; 180 181 181 182 let cmpVisual = Engine.QueryInterface(this.entity, IID_Visual); … … 183 184 cmpVisual.SelectAnimation("idle", false, 1.0); 184 185 185 delete this.target; 186 187 // The callerIID component may start healing again, 186 // The callerIID component may start again, 188 187 // replacing the callerIID, hence save that. 189 188 let callerIID = this.callerIID; … … 200 199 /** 201 200 * Heal our target entity. 202 * @params - data and lateness are unused. 201 * @param data - Unused. 202 * @param {number} lateness - The offset of the actual call and when it was expected. 203 203 */ 204 204 Heal.prototype.PerformHeal = function(data, lateness)
Note:
See TracChangeset
for help on using the changeset viewer.