Ticket #3257: capturing_alert.2.patch

File capturing_alert.2.patch, 1.6 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

     
    4545{
    4646    var cmpPlayer = Engine.QueryInterface(this.entity, IID_Player);
    4747    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);
    5054};
    5155
    5256//// External interface ////