mirror of
https://github.com/ChocoTaco1/TacoServer.git
synced 2026-07-14 15:44:34 +00:00
Fixed a double override
This commit is contained in:
parent
cef798bd5c
commit
953b7386af
2 changed files with 29 additions and 24 deletions
|
|
@ -1,16 +1,32 @@
|
||||||
//Amount of players on a team to enable turrets
|
//Amount of players on a team to enable turrets
|
||||||
//$Host::EnableTurretPlayerCount = 10;
|
//$Host::EnableTurretPlayerCount = 10;
|
||||||
|
//
|
||||||
|
//Disable MortarTurret
|
||||||
|
//$Host::EnableMortarTurret = 0;
|
||||||
|
//
|
||||||
|
//Disable = 0
|
||||||
|
//Enable = 1
|
||||||
|
|
||||||
package antiTurret {
|
package antiTurret
|
||||||
|
{
|
||||||
|
|
||||||
function TurretData::selectTarget(%this, %turret)
|
function TurretData::selectTarget(%this, %turret)
|
||||||
{
|
{
|
||||||
if( !$Host::TournamentMode && $TotalTeamPlayerCount < $Host::EnableTurretPlayerCount ) {
|
|
||||||
%turret.clearTarget();
|
if( !$Host::TournamentMode && $TotalTeamPlayerCount < $Host::EnableTurretPlayerCount )
|
||||||
}
|
{
|
||||||
else {
|
%turret.clearTarget();
|
||||||
Parent::selectTarget(%this, %turret);
|
}
|
||||||
}
|
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
|
//Disable = 0
|
||||||
//Enable = 1
|
//Enable = 1
|
||||||
//
|
|
||||||
|
|
||||||
// ban mortar turret from inventory in main gametypes
|
// ban mortar turret from inventory in main gametypes
|
||||||
if( !$Host::EnableMortarTurret ) {
|
if( !$Host::EnableMortarTurret )
|
||||||
|
{
|
||||||
|
|
||||||
$InvBanList[CTF, "MortarBarrelPack"] = 1;
|
$InvBanList[CTF, "MortarBarrelPack"] = 1;
|
||||||
$InvBanList[CnH, "MortarBarrelPack"] = 1;
|
$InvBanList[CnH, "MortarBarrelPack"] = 1;
|
||||||
|
|
@ -13,18 +15,5 @@ if( !$Host::EnableMortarTurret ) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
package noMortarTurret {
|
//Initial mortar turret barrel code moved to antiTurret.cs
|
||||||
|
//to avoid double override.
|
||||||
// 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);
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue