Browse Source

Fix using tabs instead of spaces in some places

master
Anton Tarasenko 4 years ago
parent
commit
c582d29a94
  1. 2
      sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_CrossbowPickup.uc
  2. 2
      sources/FixAmmoSelling/MutatorListener_FixAmmoSelling.uc
  3. 30
      sources/FixDualiesCost/DualiesCostRule.uc
  4. 78
      sources/FixFFHack/FFHackRule.uc
  5. 2
      sources/FixPipes/FixPipes.uc
  6. 22
      sources/FixPipes/PipesSafetyCollision.uc

2
sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_CrossbowPickup.uc

@ -22,5 +22,5 @@ class FixAmmoSellingClass_CrossbowPickup extends CrossbowPickup;
defaultproperties defaultproperties
{ {
AmmoCost = 11.6 AmmoCost = 11.6
} }

2
sources/FixAmmoSelling/MutatorListener_FixAmmoSelling.uc

@ -29,7 +29,7 @@ static function bool CheckReplacement(Actor other, out byte isSuperRelevant)
// as they might not even exist on clients. // as they might not even exist on clients.
if (class'FixAmmoSelling'.static.IsReplacer(other.class)) if (class'FixAmmoSelling'.static.IsReplacer(other.class))
{ {
ReplaceOldPickup(Pickup(other)); ReplaceOldPickup(Pickup(other));
return false; return false;
} }
CheckAbusableWeapon(KFWeapon(other)); CheckAbusableWeapon(KFWeapon(other));

30
sources/FixDualiesCost/DualiesCostRule.uc

@ -1,6 +1,6 @@
/** /**
* This rule detects any pickup events to allow us to * This rule detects any pickup events to allow us to
* properly record and/or fix pistols' prices. * properly record and/or fix pistols' prices.
* Copyright 2019 Anton Tarasenko * Copyright 2019 Anton Tarasenko
*------------------------------------------------------------------------------ *------------------------------------------------------------------------------
* This file is part of Acedia. * This file is part of Acedia.
@ -21,22 +21,22 @@
class DualiesCostRule extends GameRules; class DualiesCostRule extends GameRules;
function bool OverridePickupQuery( function bool OverridePickupQuery(
Pawn other, Pawn other,
Pickup item, Pickup item,
out byte allowPickup out byte allowPickup
) )
{ {
local KFWeaponPickup weaponPickup; local KFWeaponPickup weaponPickup;
local FixDualiesCost dualiesCostFix; local FixDualiesCost dualiesCostFix;
weaponPickup = KFWeaponPickup(item); weaponPickup = KFWeaponPickup(item);
dualiesCostFix = FixDualiesCost(class'FixDualiesCost'.static.GetInstance()); dualiesCostFix = FixDualiesCost(class'FixDualiesCost'.static.GetInstance());
if (weaponPickup != none && dualiesCostFix != none) if (weaponPickup != none && dualiesCostFix != none)
{ {
dualiesCostFix.ApplyPendingValues(); dualiesCostFix.ApplyPendingValues();
dualiesCostFix.StoreSinglePistolValues(); dualiesCostFix.StoreSinglePistolValues();
dualiesCostFix.SetNextSellValue(weaponPickup.sellValue); dualiesCostFix.SetNextSellValue(weaponPickup.sellValue);
} }
return super.OverridePickupQuery(other, item, allowPickup); return super.OverridePickupQuery(other, item, allowPickup);
} }
defaultproperties defaultproperties

78
sources/FixFFHack/FFHackRule.uc

@ -1,6 +1,6 @@
/** /**
* This rule detects suspicious attempts to deal damage and * This rule detects suspicious attempts to deal damage and
* applies friendly fire scaling according to 'FixFFHack's rules. * applies friendly fire scaling according to 'FixFFHack's rules.
* Copyright 2019 Anton Tarasenko * Copyright 2019 Anton Tarasenko
*------------------------------------------------------------------------------ *------------------------------------------------------------------------------
* This file is part of Acedia. * This file is part of Acedia.
@ -21,51 +21,53 @@
class FFHackRule extends GameRules; class FFHackRule extends GameRules;
function int NetDamage( function int NetDamage(
int originalDamage, int originalDamage,
int damage, int damage,
Pawn injured, Pawn injured,
Pawn instigator, Pawn instigator,
Vector hitLocation, Vector hitLocation,
out Vector momentum, out Vector momentum,
class<DamageType> damageType class<DamageType> damageType
) )
{ {
local KFGameType gameType; local KFGameType gameType;
local FixFFHack ffHackFix; local FixFFHack ffHackFix;
gameType = KFGameType(level.game); gameType = KFGameType(level.game);
// Something is very wrong and we can just bail on this damage // Something is very wrong and we can just bail on this damage
if (damageType == none || gameType == none) return 0; if (damageType == none || gameType == none) {
return 0;
}
// We only check when suspicious instigators that aren't a world // We only check when suspicious instigators that aren't a world
if (!damageType.default.bCausedByWorld && IsSuspicious(instigator)) if (!damageType.default.bCausedByWorld && IsSuspicious(instigator))
{ {
ffHackFix = FixFFHack(class'FixFFHack'.static.GetInstance()); ffHackFix = FixFFHack(class'FixFFHack'.static.GetInstance());
if (ffHackFix != none && ffHackFix.ShouldScaleDamage(damageType)) if (ffHackFix != none && ffHackFix.ShouldScaleDamage(damageType))
{ {
// Remove pushback to avoid environmental kills // Remove pushback to avoid environmental kills
momentum = Vect(0.0, 0.0, 0.0); momentum = Vect(0.0, 0.0, 0.0);
damage *= gameType.friendlyFireScale; damage *= gameType.friendlyFireScale;
} }
} }
return super.NetDamage( originalDamage, damage, injured, instigator, return super.NetDamage( originalDamage, damage, injured, instigator,
hitLocation, momentum, damageType); hitLocation, momentum, damageType);
} }
private function bool IsSuspicious(Pawn instigator) private function bool IsSuspicious(Pawn instigator)
{ {
// Instigator vanished // Instigator vanished
if (instigator == none) return true; if (instigator == none) return true;
// Instigator already became spectator // Instigator already became spectator
if (KFPawn(instigator) != none) if (KFPawn(instigator) != none)
{ {
if (instigator.playerReplicationInfo != none) if (instigator.playerReplicationInfo != none)
{ {
return instigator.playerReplicationInfo.bOnlySpectator; return instigator.playerReplicationInfo.bOnlySpectator;
} }
return true; // Replication info is gone => suspicious return true; // Replication info is gone => suspicious
} }
return false; return false;
} }
defaultproperties defaultproperties

2
sources/FixPipes/FixPipes.uc

@ -316,7 +316,7 @@ private final function DoPipeProximityCheck(
Vector checkLocation) Vector checkLocation)
{ {
local Pawn checkPawn; local Pawn checkPawn;
local float threatLevel; local float threatLevel;
local PipeBombProjectile pipe; local PipeBombProjectile pipe;
pipe = pipeRecord.pipe; pipe = pipeRecord.pipe;
pipe.bAlwaysRelevant = false; pipe.bAlwaysRelevant = false;

22
sources/FixPipes/PipesSafetyCollision.uc

@ -46,18 +46,18 @@ public final static function PipesSafetyCollision ProtectPipes(
// particular fixes. // particular fixes.
private function bool IsSuspicious(Pawn instigator) private function bool IsSuspicious(Pawn instigator)
{ {
// Instigator vanished // Instigator vanished
if (instigator == none) return true; if (instigator == none) return true;
// Instigator already became spectator // Instigator already became spectator
if (KFPawn(instigator) != none) if (KFPawn(instigator) != none)
{ {
if (instigator.playerReplicationInfo != none) { if (instigator.playerReplicationInfo != none) {
return instigator.playerReplicationInfo.bOnlySpectator; return instigator.playerReplicationInfo.bOnlySpectator;
} }
return true; // Replication info is gone => suspicious return true; // Replication info is gone => suspicious
} }
return false; return false;
} }
// Revert changes made by caller `PipesSafetyCollision`, letting corresponding // Revert changes made by caller `PipesSafetyCollision`, letting corresponding

Loading…
Cancel
Save