mirror of
https://github.com/ChocoTaco1/TacoServer.git
synced 2026-03-06 05:00:21 +00:00
Flag Escort Fix
Incorrect code involving Flag Escorting
This commit is contained in:
parent
f414c83714
commit
99d6f97cbb
1 changed files with 48 additions and 0 deletions
48
Classic/scripts/autoexec/FlagEscortFix.cs
Normal file
48
Classic/scripts/autoexec/FlagEscortFix.cs
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
package FlagEscortFix
|
||||
{
|
||||
|
||||
function CTFGame::onClientDamaged(%game, %clVictim, %clAttacker, %damageType, %implement, %damageLoc)
|
||||
{
|
||||
parent::onClientDamaged(%game, %clVictim, %clAttacker, %damageType, %implement, %damageLoc);
|
||||
//if victim is carrying a flag and is not on the attackers team, mark the attacker as a threat for x seconds(for scoring purposes)
|
||||
if ((%clVictim.player.holdingFlag !$= "") && (%clVictim.team != %clAttacker.team))
|
||||
{
|
||||
%clAttacker.dmgdFlagCarrier = true;
|
||||
cancel(%clAttacker.threatTimer); //restart timer
|
||||
%clAttacker.threatTimer = schedule(%game.TIME_CONSIDERED_FLAGCARRIER_THREAT,0,"dmgFlagReset",%clAttacker);
|
||||
}
|
||||
}
|
||||
|
||||
function SCtFGame::onClientDamaged(%game, %clVictim, %clAttacker, %damageType, %implement, %damageLoc)
|
||||
{
|
||||
parent::onClientDamaged(%game, %clVictim, %clAttacker, %damageType, %implement, %damageLoc);
|
||||
//if victim is carrying a flag and is not on the attackers team, mark the attacker as a threat for x seconds(for scoring purposes)
|
||||
if ((%clVictim.player.holdingFlag !$= "") && (%clVictim.team != %clAttacker.team))
|
||||
{
|
||||
%clAttacker.dmgdFlagCarrier = true;
|
||||
cancel(%clAttacker.threatTimer); //restart timer
|
||||
%clAttacker.threatTimer = schedule(%game.TIME_CONSIDERED_FLAGCARRIER_THREAT,0,"dmgFlagReset",%clAttacker);
|
||||
}
|
||||
}
|
||||
|
||||
function PracticeCTFGame::onClientDamaged(%game, %clVictim, %clAttacker, %damageType, %implement, %damageLoc)
|
||||
{
|
||||
parent::onClientDamaged(%game, %clVictim, %clAttacker, %damageType, %implement, %damageLoc);
|
||||
//if victim is carrying a flag and is not on the attackers team, mark the attacker as a threat for x seconds(for scoring purposes)
|
||||
if ((%clVictim.player.holdingFlag !$= "") && (%clVictim.team != %clAttacker.team))
|
||||
{
|
||||
%clAttacker.dmgdFlagCarrier = true;
|
||||
cancel(%clAttacker.threatTimer); //restart timer
|
||||
%clAttacker.threatTimer = schedule(%game.TIME_CONSIDERED_FLAGCARRIER_THREAT,0,"dmgFlagReset",%clAttacker);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
function dmgFlagReset(%clAttacker){
|
||||
%clAttacker.dmgdFlagCarrier = false;
|
||||
}
|
||||
|
||||
// Prevent package from being activated if it is already
|
||||
if (!isActivePackage(FlagEscortFix))
|
||||
activatePackage(FlagEscortFix);
|
||||
Loading…
Add table
Add a link
Reference in a new issue