Ticket #3257: capturing_alert.2.patch
File capturing_alert.2.patch, 1.6 KB (added by , 9 years ago) |
---|
-
binaries/data/mods/public/simulation/components/Armour.js
49 49 */ 50 50 Armour.prototype.TakeDamage = function(hack, pierce, crush, source) 51 51 { 52 // Alert target owner of attack53 var cmpAttackDetection = QueryOwnerInterface(this.entity, IID_AttackDetection);54 if (cmpAttackDetection)55 {56 var now = Engine.QueryInterface(SYSTEM_ENTITY, IID_Timer).GetTime();57 if (now > this.nextAlertTime)58 {59 this.nextAlertTime = now + cmpAttackDetection.GetSuppressionTime();60 cmpAttackDetection.AttackAlert(this.entity, source);61 }62 }63 64 52 if (this.invulnerable) 65 53 return { "killed": false, "change": 0 }; 66 54 -
binaries/data/mods/public/simulation/components/AttackDetection.js
45 45 { 46 46 var cmpPlayer = Engine.QueryInterface(this.entity, IID_Player); 47 47 var cmpOwnership = Engine.QueryInterface(msg.target, IID_Ownership); 48 if (cmpOwnership.GetOwner() == cmpPlayer.GetPlayerID()) 49 Engine.PostMessage(msg.target, MT_MinimapPing); 48 if (cmpOwnership.GetOwner() != cmpPlayer.GetPlayerID()) 49 return; 50 Engine.PostMessage(msg.target, MT_MinimapPing); 51 52 // Alert target owner of attack 53 this.AttackAlert(msg.target, msg.attacker); 50 54 }; 51 55 52 56 //// External interface ////