Ticket #3257: capturing_alert.patch

File capturing_alert.patch, 1.5 KB (added by Vladislav Belov, 9 years ago)
  • binaries/data/mods/public/simulation/components/Armour.js

     
    4949 */
    5050Armour.prototype.TakeDamage = function(hack, pierce, crush, source)
    5151{
    52     // Alert target owner of attack
    53     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 
    6452    if (this.invulnerable)
    6553        return { "killed": false, "change": 0 };
    6654
  • binaries/data/mods/public/simulation/components/AttackDetection.js

     
    4747    var cmpOwnership = Engine.QueryInterface(msg.target, IID_Ownership);
    4848    if (cmpOwnership.GetOwner() == cmpPlayer.GetPlayerID())
    4949        Engine.PostMessage(msg.target, MT_MinimapPing);
     50
     51    // Alert target owner of attack
     52    this.AttackAlert(msg.target, msg.attacker);
    5053};
    5154
    5255//// External interface ////