mirror of
https://github.com/ChocoTaco1/TacoServer.git
synced 2026-01-20 00:24:49 +00:00
Fixed a double override
This commit is contained in:
parent
cef798bd5c
commit
953b7386af
|
|
@ -1,16 +1,32 @@
|
|||
//Amount of players on a team to enable turrets
|
||||
//$Host::EnableTurretPlayerCount = 10;
|
||||
//
|
||||
//Disable MortarTurret
|
||||
//$Host::EnableMortarTurret = 0;
|
||||
//
|
||||
//Disable = 0
|
||||
//Enable = 1
|
||||
|
||||
package antiTurret {
|
||||
package antiTurret
|
||||
{
|
||||
|
||||
function TurretData::selectTarget(%this, %turret)
|
||||
{
|
||||
if( !$Host::TournamentMode && $TotalTeamPlayerCount < $Host::EnableTurretPlayerCount ) {
|
||||
%turret.clearTarget();
|
||||
}
|
||||
else {
|
||||
Parent::selectTarget(%this, %turret);
|
||||
}
|
||||
|
||||
if( !$Host::TournamentMode && $TotalTeamPlayerCount < $Host::EnableTurretPlayerCount )
|
||||
{
|
||||
%turret.clearTarget();
|
||||
}
|
||||
else if( $Host::EnableMortarTurret )
|
||||
{
|
||||
Parent::selectTarget(%this, %turret);
|
||||
}
|
||||
//No possibility of mortar turret working if map already has it and its banned.
|
||||
else if( %turret.initialBarrel !$= "MortarBarrelLarge" )
|
||||
{
|
||||
Parent::selectTarget(%this, %turret);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,9 +3,11 @@
|
|||
//
|
||||
//Disable = 0
|
||||
//Enable = 1
|
||||
//
|
||||
|
||||
|
||||
// ban mortar turret from inventory in main gametypes
|
||||
if( !$Host::EnableMortarTurret ) {
|
||||
if( !$Host::EnableMortarTurret )
|
||||
{
|
||||
|
||||
$InvBanList[CTF, "MortarBarrelPack"] = 1;
|
||||
$InvBanList[CnH, "MortarBarrelPack"] = 1;
|
||||
|
|
@ -13,18 +15,5 @@ if( !$Host::EnableMortarTurret ) {
|
|||
|
||||
}
|
||||
|
||||
package noMortarTurret {
|
||||
|
||||
// if a mortar turret somehow makes it into the game, keep it from working
|
||||
function TurretData::selectTarget(%this, %turret) {
|
||||
|
||||
if( %turret.initialBarrel !$= "MortarBarrelLarge" ) {
|
||||
Parent::selectTarget(%this, %turret);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
// Prevent package from being activated if it is already
|
||||
if (!isActivePackage(noMortarTurret))
|
||||
activatePackage(noMortarTurret);
|
||||
//Initial mortar turret barrel code moved to antiTurret.cs
|
||||
//to avoid double override.
|
||||
Loading…
Reference in a new issue