2020-02-28 16:36:38 -05:00
|
|
|
package FlagEscortFix
|
|
|
|
|
{
|
|
|
|
|
|
2020-02-29 15:45:07 -05:00
|
|
|
function CTFGame::onClientDamaged(%game, %clVictim, %clAttacker, %damageType, %implement, %damageLoc){
|
2020-02-28 16:36:38 -05:00
|
|
|
parent::onClientDamaged(%game, %clVictim, %clAttacker, %damageType, %implement, %damageLoc);
|
|
|
|
|
if ((%clVictim.player.holdingFlag !$= "") && (%clVictim.team != %clAttacker.team))
|
2020-02-29 15:45:07 -05:00
|
|
|
%clAttacker.dmgdFlagTime = getSimTime();
|
|
|
|
|
}
|
|
|
|
|
function CTFGame::testEscortAssist(%game, %victimID, %killerID){
|
|
|
|
|
if((getSimTime() - %victimID.dmgdFlagTime) < %game.TIME_CONSIDERED_FLAGCARRIER_THREAT)
|
|
|
|
|
return true;
|
|
|
|
|
return false;
|
2020-02-28 16:36:38 -05:00
|
|
|
}
|
|
|
|
|
|
2020-02-29 15:45:07 -05:00
|
|
|
function SCtFGame::onClientDamaged(%game, %clVictim, %clAttacker, %damageType, %implement, %damageLoc){
|
2020-02-28 16:36:38 -05:00
|
|
|
parent::onClientDamaged(%game, %clVictim, %clAttacker, %damageType, %implement, %damageLoc);
|
|
|
|
|
if ((%clVictim.player.holdingFlag !$= "") && (%clVictim.team != %clAttacker.team))
|
2020-02-29 15:45:07 -05:00
|
|
|
%clAttacker.dmgdFlagTime = getSimTime();
|
|
|
|
|
}
|
|
|
|
|
function SCtFGame::testEscortAssist(%game, %victimID, %killerID){
|
|
|
|
|
if((getSimTime() - %victimID.dmgdFlagTime) < %game.TIME_CONSIDERED_FLAGCARRIER_THREAT)
|
|
|
|
|
return true;
|
|
|
|
|
return false;
|
2020-02-28 16:36:38 -05:00
|
|
|
}
|
|
|
|
|
|
2020-02-29 15:45:07 -05:00
|
|
|
function PracticeCTFGame::onClientDamaged(%game, %clVictim, %clAttacker, %damageType, %implement, %damageLoc){
|
2020-02-28 16:36:38 -05:00
|
|
|
parent::onClientDamaged(%game, %clVictim, %clAttacker, %damageType, %implement, %damageLoc);
|
|
|
|
|
if ((%clVictim.player.holdingFlag !$= "") && (%clVictim.team != %clAttacker.team))
|
2020-02-29 15:45:07 -05:00
|
|
|
%clAttacker.dmgdFlagTime = getSimTime();
|
|
|
|
|
}
|
|
|
|
|
function PracticeCTFGame::testEscortAssist(%game, %victimID, %killerID){
|
|
|
|
|
if((getSimTime() - %victimID.dmgdFlagTime) < %game.TIME_CONSIDERED_FLAGCARRIER_THREAT)
|
|
|
|
|
return true;
|
|
|
|
|
return false;
|
2020-02-28 16:36:38 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Prevent package from being activated if it is already
|
|
|
|
|
if (!isActivePackage(FlagEscortFix))
|
|
|
|
|
activatePackage(FlagEscortFix);
|