Browse Source

Fix code/comment style

master
Anton Tarasenko 4 years ago
parent
commit
aacadf6c7c
  1. 50
      config/AcediaFixes.ini
  2. 6
      sources/FixAmmoSelling/AmmoPickupStalker.uc
  3. 40
      sources/FixAmmoSelling/FixAmmoSelling.uc
  4. 2
      sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_CamoM32Pickup.uc
  5. 2
      sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_CrossbowPickup.uc
  6. 2
      sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_GoldenM79Pickup.uc
  7. 2
      sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_LAWPickup.uc
  8. 2
      sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_M32Pickup.uc
  9. 2
      sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_M79Pickup.uc
  10. 2
      sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_PipeBombPickup.uc
  11. 2
      sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_SPGrenadePickup.uc
  12. 2
      sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_SealSquealPickup.uc
  13. 2
      sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_SeekerSixPickup.uc
  14. 4
      sources/FixAmmoSelling/MutatorListener_FixAmmoSelling.uc
  15. 14
      sources/FixDoshSpam/FixDoshSpam.uc
  16. 2
      sources/FixDoshSpam/MutatorListener_FixDoshSpam.uc
  17. 54
      sources/FixDualiesCost/FixDualiesCost.uc
  18. 2
      sources/FixFFHack/FFHackRule.uc
  19. 13
      sources/FixFFHack/FixFFHack.uc
  20. 38
      sources/FixInfiniteNades/FixInfiniteNades.uc
  21. 4
      sources/FixInfiniteNades/FixedFragFire.uc
  22. 2
      sources/FixInfiniteNades/MutatorListener_FixInfiniteNades.uc
  23. 8
      sources/FixInventoryAbuse/FixInventoryAbuse.uc
  24. 3
      sources/FixPipes/FixPipes.uc
  25. 42
      sources/FixSpectatorCrash/FixSpectatorCrash.uc
  26. 26
      sources/FixZedTimeLags/FixZedTimeLags.uc

50
config/AcediaFixes.ini

@ -38,7 +38,7 @@ autoEnable=true
; These people are, without a question, complete degenerates. ; These people are, without a question, complete degenerates.
; But making mods for only non-mentally challenged isn't inclusive. ; But making mods for only non-mentally challenged isn't inclusive.
; So we add this option. ; So we add this option.
; Set it to 'false' if you only want to fix ammo printing ; Set it to `false` if you only want to fix ammo printing
; and leave the rest of the bullshit as-is. ; and leave the rest of the bullshit as-is.
allowSellValueIncrease=true allowSellValueIncrease=true
@ -55,10 +55,10 @@ autoEnable=true
; The problem is, due to how ammo purchase is coded, low-level (<6 lvl) ; The problem is, due to how ammo purchase is coded, low-level (<6 lvl)
; players can actually buy more ammo for "fixed" weapons than they can afford ; players can actually buy more ammo for "fixed" weapons than they can afford
; by filling ammo for one or all weapons. ; by filling ammo for one or all weapons.
; Setting this flag to 'true' will allow us to still take full cost ; Setting this flag to `true` will allow us to still take full cost
; from them, putting them in "debt" (having negative dosh amount). ; from them, putting them in "debt" (having negative dosh amount).
; If you don't want to have players with negative dosh values on your server ; If you don't want to have players with negative dosh values on your server
; as a side-effect of this fix, then leave this flag as 'false', ; as a side-effect of this fix, then leave this flag as `false`,
; letting low level players buy ammo cheaper ; letting low level players buy ammo cheaper
; (but not cheaper than lvl6 could). ; (but not cheaper than lvl6 could).
; NOTE: this issue doesn't affect level 6 players. ; NOTE: this issue doesn't affect level 6 players.
@ -95,12 +95,12 @@ dualiesClasses=(single=class'KFMod.FlareRevolverPickup',dual=class'KFMod.DualFla
[AcediaFixes.FixInfiniteNades] [AcediaFixes.FixInfiniteNades]
; This feature fixes a vulnerability in a code of 'Frag' that can allow ; This feature fixes a vulnerability in a code of `Frag` that can allow
; player to throw grenades even when he no longer has any. ; player to throw grenades even when he no longer has any.
; There's also no cooldowns on the throw, which can lead to a server crash. ; There's also no cooldowns on the throw, which can lead to a server crash.
autoEnable=true autoEnable=true
; Setting this flag to 'true' will allow to throw grenades by calling ; Setting this flag to `true` will allow to throw grenades by calling
; 'ServerThrow' directly, as long as player has necessary ammo. ; `ServerThrow()` directly, as long as player has necessary ammo.
; This can allow some players to throw grenades much quicker than intended, ; This can allow some players to throw grenades much quicker than intended,
; so if you wish to prevent it, keep this flag set to `false`. ; so if you wish to prevent it, keep this flag set to `false`.
ignoreTossFlags=true ignoreTossFlags=true
@ -108,9 +108,9 @@ ignoreTossFlags=true
[AcediaFixes.FixDoshSpam] [AcediaFixes.FixDoshSpam]
; This feature addressed two dosh-related issues: ; This feature addressed two dosh-related issues:
; 1. Crashing servers by spamming 'CashPickup' actors with 'TossCash'; ; 1. Crashing servers by spamming `CashPickup` actors with `TossCash()`;
; 2. Breaking collision detection logic by stacking large amount of ; 2. Breaking collision detection logic by stacking large amount of
; 'CashPickup' actors in one place, which allows one to either ; `CashPickup` actors in one place, which allows one to either
; reach unintended locations or even instantly kill zeds. ; reach unintended locations or even instantly kill zeds.
; ;
; It fixes them by limiting speed, with which dosh can spawn, and ; It fixes them by limiting speed, with which dosh can spawn, and
@ -129,8 +129,8 @@ autoEnable=true
doshPerSecondLimitMax=50 doshPerSecondLimitMax=50
doshPerSecondLimitMin=5 doshPerSecondLimitMin=5
; Amount of dosh pickups on the map at which we must set dosh per second ; Amount of dosh pickups on the map at which we must set dosh per second
; to 'doshPerSecondLimitMin'. ; to `doshPerSecondLimitMin`.
; We use 'doshPerSecondLimitMax' when there's no dosh on the map and ; We use `doshPerSecondLimitMax` when there's no dosh on the map and
; scale linearly between them as it's amount grows. ; scale linearly between them as it's amount grows.
criticalDoshAmount=25 criticalDoshAmount=25
@ -141,7 +141,7 @@ criticalDoshAmount=25
autoEnable=true autoEnable=true
; This fix will try to kick any player that switches between active player ; This fix will try to kick any player that switches between active player
; and cooldown faster than time (in seconds) in this value. ; and cooldown faster than time (in seconds) in this value.
; NOTE: raising this value past default value of '0.25' ; NOTE: raising this value past default value of `0.25`
; won't actually improve crash prevention, but might cause regular players to ; won't actually improve crash prevention, but might cause regular players to
; get accidentally kicked. ; get accidentally kicked.
spectatorChangeTimeout=0.25 spectatorChangeTimeout=0.25
@ -149,14 +149,14 @@ spectatorChangeTimeout=0.25
; Allows you to turn off server blocking. ; Allows you to turn off server blocking.
; Players that don't respect timeout will still be kicked. ; Players that don't respect timeout will still be kicked.
; This might be needed if this fix conflicts with another mutator ; This might be needed if this fix conflicts with another mutator
; that also changes 'numPlayers'. ; that also changes `numPlayers`.
; This option is necessary to block aggressive enough server crash ; This option is necessary to block aggressive enough server crash
; attempts, but can cause compatibility issues with some mutators. ; attempts, but can cause compatibility issues with some mutators.
; It's highly recommended to rewrite such a mutator to be compatible instead. ; It's highly recommended to rewrite such a mutator to be compatible instead.
; NOTE: fix should be compatible with most faked players-type mutators, ; NOTE: fix should be compatible with most faked players-type mutators,
; since this it remembers the difference between amount of ; since this it remembers the difference between amount of
; real players and 'numPlayers'. ; real players and `numPlayers`.
; After unblocking, it sets 'numPlayers' to ; After unblocking, it sets `numPlayers` to
; the current amount of real players + that difference. ; the current amount of real players + that difference.
; So 4 players + 3 (=7 numPlayers) after kicking 1 player becomes ; So 4 players + 3 (=7 numPlayers) after kicking 1 player becomes
; 3 players + 3 (=6 numPlayers). ; 3 players + 3 (=6 numPlayers).
@ -174,8 +174,8 @@ allowServerBlock=true
autoEnable=true autoEnable=true
; Defines a general rule for chosing whether or not to apply ; Defines a general rule for chosing whether or not to apply
; friendly fire scaling. ; friendly fire scaling.
; This can be overwritten by exceptions ('alwaysScale' or 'neverScale'). ; This can be overwritten by exceptions (`alwaysScale` or `neverScale`).
; Enabling scaling by default without any exceptions in 'neverScale' will ; Enabling scaling by default without any exceptions in `neverScale` will
; make this fix behave almost identically to Mutant's 'Explosives Fix Mutator'. ; make this fix behave almost identically to Mutant's 'Explosives Fix Mutator'.
scaleByDefault=false scaleByDefault=false
; Damage types, for which we should always reaaply friendly fire scaling. ; Damage types, for which we should always reaaply friendly fire scaling.
@ -267,9 +267,9 @@ ignoreFriendlyFire=false
[AcediaFixes.FixZedTimeLags] [AcediaFixes.FixZedTimeLags]
; When zed time activates, game speed is immediately set to ; When zed time activates, game speed is immediately set to
; 'zedTimeSlomoScale' (0.2 by default), defined, like all other variables, ; `zedTimeSlomoScale` (0.2 by default), defined, like all other variables,
; in 'KFGameType'. Zed time lasts 'zedTimeDuration' seconds (3.0 by default), ; in `KFGameType`. Zed time lasts `zedTimeDuration` seconds (3.0 by default),
; but during last 'zedTimeDuration * 0.166' seconds (by default 0.498) ; but during last `zedTimeDuration * 0.166` seconds (by default 0.498)
; it starts to speed back up, causing game speed to update every tick. ; it starts to speed back up, causing game speed to update every tick.
; This makes animations look more smooth when exiting zed-time. ; This makes animations look more smooth when exiting zed-time.
; However, updating speed every tick for that purpose seems like ; However, updating speed every tick for that purpose seems like
@ -279,8 +279,8 @@ ignoreFriendlyFire=false
; This fix limits amount of actual game speed updates, alleviating the issue. ; This fix limits amount of actual game speed updates, alleviating the issue.
; ;
; As a side effect it also fixes an issue where during zed time speed up ; As a side effect it also fixes an issue where during zed time speed up
; 'zedTimeSlomoScale' was assumed to be default value of '0.2'. ; `zedTimeSlomoScale` was assumed to be default value of `0.2`.
; Now zed time will behave correctly with mods that change 'zedTimeSlomoScale'. ; Now zed time will behave correctly with mods that change `zedTimeSlomoScale`.
autoEnable=true autoEnable=true
; Maximum amount of game speed updates upon leaving zed time. ; Maximum amount of game speed updates upon leaving zed time.
; 2 or 3 seem to provide a good enough result that, ; 2 or 3 seem to provide a good enough result that,
@ -292,10 +292,10 @@ autoEnable=true
; about 13 updates total (without this fix). ; about 13 updates total (without this fix).
maxGameSpeedUpdatesAmount=3 maxGameSpeedUpdatesAmount=3
; [ADVANCED] Don't change this setting unless you know what you're doing. ; [ADVANCED] Don't change this setting unless you know what you're doing.
; Compatibility setting that allows to keep 'GameInfo' 's 'Tick' event ; Compatibility setting that allows to keep `GameInfo`'s `Tick` event
; from being disabled. ; from being disabled.
; Useful when running Acedia along with custom 'GameInfo' ; Useful when running Acedia along with custom `GameInfo`
; (that isn't 'KFGameType') that relies on 'Tick' event. ; (that isn't `KFGameType`) that relies on `Tick` event.
; Note, however, that in order to keep this fix working properly, ; Note, however, that in order to keep this fix working properly,
; it's on you to make sure 'KFGameType.Tick()' logic isn't executed. ; it's on you to make sure `KFGameType.Tick()` logic isn't executed.
disableTick=true disableTick=true

6
sources/FixAmmoSelling/AmmoPickupStalker.uc

@ -24,9 +24,9 @@ class AmmoPickupStalker extends Actor;
// If it is destroyed (not just picked up) - stalker must die too. // If it is destroyed (not just picked up) - stalker must die too.
var private KFAmmoPickup target; var private KFAmmoPickup target;
// This variable is used to record if our 'target' ammo box was in // This variable is used to record if our `target` ammo box was in
// active state ('Pickup') last time we've checked. // active state (`Pickup`) last time we've checked.
// We need this because ammo box's 'Touch' event can fire off first and // We need this because ammo box's `Touch()` event can fire off first and
// force the box to sleep before stalker could catch same event. // force the box to sleep before stalker could catch same event.
// Without this variable we would have no way to know if player // Without this variable we would have no way to know if player
// simply walked near the place of a sleeping box or actually grabbed it. // simply walked near the place of a sleeping box or actually grabbed it.

40
sources/FixAmmoSelling/FixAmmoSelling.uc

@ -8,11 +8,11 @@
* notably pipe bombs (74% discount for lvl6 demolition) * notably pipe bombs (74% discount for lvl6 demolition)
* and crossbow (42% discount for lvl6 sharpshooter). * and crossbow (42% discount for lvl6 sharpshooter).
* *
* This feature fixes this problem by setting 'pickupClass' variable in * This feature fixes this problem by setting `pickupClass` variable in
* potentially abusable weapons to our own value that won't receive a discount. * potentially abusable weapons to our own value that won't receive a discount.
* Luckily for us, it seems that pickup spawn and discount checks are the only * Luckily for us, it seems that pickup spawn and discount checks are the only
* two place where variable is directly checked in a vanilla game's code * two place where variable is directly checked in a vanilla game's code
* ('default.pickupClass' is used everywhere else), * (`default.pickupClass` is used everywhere else),
* so we can easily deal with the side effects of such change. * so we can easily deal with the side effects of such change.
* Copyright 2020 Anton Tarasenko * Copyright 2020 Anton Tarasenko
*------------------------------------------------------------------------------ *------------------------------------------------------------------------------
@ -35,23 +35,23 @@ class FixAmmoSelling extends Feature
config(AcediaFixes); config(AcediaFixes);
/** /**
* We will replace 'pickupClass' variable for all instances of potentially * We will replace `pickupClass` variable for all instances of potentially
* abusable weapons. That is weapons, that have a discount for their ammunition * abusable weapons. That is weapons, that have a discount for their ammunition
* (via 'GetAmmoCostScaling' function in a corresponding perk class). * (via `GetAmmoCostScaling()` function in a corresponding perk class).
* They are defined (along with our pickup replacements) in 'rules' array. * They are defined (along with our pickup replacements) in `rules` array.
* That array isn't configurable, since the abusable status is hardcoded into * That array isn't configurable, since the abusable status is hardcoded into
* perk classes and the main mod that allows to change those (ServerPerks), * perk classes and the main mod that allows to change those (ServerPerks),
* also solves ammo selling by a more direct method * also solves ammo selling by a more direct method
* (only available for the mods that replace player pawn class). * (only available for the mods that replace player pawn class).
* This change already completely fixes ammo printing. * This change already completely fixes ammo printing.
* Possible concern with changing the value of 'pickupClass' is that * Possible concern with changing the value of `pickupClass` is that
* it might affect gameplay in too many ways. * it might affect gameplay in too many ways.
* But, luckily for us, that value is only used when spawning a new pickup and * But, luckily for us, that value is only used when spawning a new pickup and
* in 'ServerBuyAmmo' function of 'KFPawn' * in `ServerBuyAmmo` function of `KFPawn`
* (all the other places use it's default value instead). * (all the other places use it's default value instead).
* This means that the only two side-effects of our change are: * This means that the only two side-effects of our change are:
* 1. That wrong pickup class will be spawned. This problem is easily * 1. That wrong pickup class will be spawned. This problem is easily
* solved by replacing spawned actor in 'CheckReplacement'. * solved by replacing spawned actor in `CheckReplacement()`.
* 2. That ammo will be sold at a different (lower for us) price, * 2. That ammo will be sold at a different (lower for us) price,
* while trader would still display and require the original price. * while trader would still display and require the original price.
* This problem is solved by manually taking from player the difference * This problem is solved by manually taking from player the difference
@ -74,15 +74,15 @@ class FixAmmoSelling extends Feature
* First, all cases of ammo boxes outside the trader are easy to detect, * First, all cases of ammo boxes outside the trader are easy to detect,
* since in this case we can be sure that player didn't buy ammo * since in this case we can be sure that player didn't buy ammo
* (and mods that can allow it can just get rid of * (and mods that can allow it can just get rid of
* 'ServerSellAmmo' function directly, similarly to how ServerPerks does it). * `ServerSellAmmo()` function directly, similarly to how ServerPerks does it).
* We'll detect all the other boxes by attaching an auxiliary actor * We'll detect all the other boxes by attaching an auxiliary actor
* ('AmmoPickupStalker') to them, that will fire off 'Touch' event * (`AmmoPickupStalker`) to them, that will fire off `Touch()` event
* at the same time as ammo boxes. * at the same time as ammo boxes.
* The only possible problem is that part of the ammo cost is * The only possible problem is that part of the ammo cost is
* taken with a slight delay, which leaves cheaters a window of opportunity * taken with a slight delay, which leaves cheaters a window of opportunity
* to buy more than they can afford. * to buy more than they can afford.
* This issue is addressed by each ammo type costing as little as possible * This issue is addressed by each ammo type costing as little as possible
* (its' cost for corresponding perk at lvl6) * (it's cost for corresponding perk at lvl6)
* and a flag that does allow players to go into negative dosh values * and a flag that does allow players to go into negative dosh values
* (the cost is potential bugs in this fix itself, that * (the cost is potential bugs in this fix itself, that
* can somewhat affect regular players). * can somewhat affect regular players).
@ -94,10 +94,10 @@ class FixAmmoSelling extends Feature
// The problem is, due to how ammo purchase is coded, low-level (<6 lvl) // The problem is, due to how ammo purchase is coded, low-level (<6 lvl)
// players can actually buy more ammo for "fixed" weapons than they can afford // players can actually buy more ammo for "fixed" weapons than they can afford
// by filling ammo for one or all weapons. // by filling ammo for one or all weapons.
// Setting this flag to 'true' will allow us to still take full cost // Setting this flag to `true` will allow us to still take full cost
// from them, putting them in "debt" (having negative dosh amount). // from them, putting them in "debt" (having negative dosh amount).
// If you don't want to have players with negative dosh values on your server // If you don't want to have players with negative dosh values on your server
// as a side-effect of this fix, then leave this flag as 'false', // as a side-effect of this fix, then leave this flag as `false`,
// letting low level players buy ammo cheaper // letting low level players buy ammo cheaper
// (but not cheaper than lvl6 could). // (but not cheaper than lvl6 could).
// NOTE: this issue doesn't affect level 6 players. // NOTE: this issue doesn't affect level 6 players.
@ -153,7 +153,7 @@ protected function OnDisabled()
local int i; local int i;
local AmmoPickupStalker nextStalker; local AmmoPickupStalker nextStalker;
local array<AmmoPickupStalker> stalkers; local array<AmmoPickupStalker> stalkers;
// Restore all the 'pickupClass' variables we've changed. // Restore all the `pickupClass` variables we've changed.
for (i = 0; i < registeredWeapons.length; i += 1) for (i = 0; i < registeredWeapons.length; i += 1)
{ {
if (registeredWeapons[i].weapon != none) if (registeredWeapons[i].weapon != none)
@ -242,7 +242,7 @@ private final function WeaponRecord FindAmmoInstance(WeaponRecord record)
return record; return record;
} }
// Calculates how much more player should have paid for 'ammoAmount' // Calculates how much more player should have paid for `ammoAmount`
// amount of ammo, compared to how much trader took after our fix. // amount of ammo, compared to how much trader took after our fix.
private final function float GetPriceCorrection( private final function float GetPriceCorrection(
KFWeapon kfWeapon, KFWeapon kfWeapon,
@ -250,9 +250,9 @@ private final function float GetPriceCorrection(
) )
{ {
local float boughtMagFraction; local float boughtMagFraction;
// 'vanillaPrice' - price that would be calculated // `vanillaPrice` - price that would be calculated
// without our interference // without our interference
// 'fixPrice' - price that will be calculated after // `fixPrice` - price that will be calculated after
// we've replaced pickup class // we've replaced pickup class
local float vanillaPrice, fixPrice; local float vanillaPrice, fixPrice;
local KFPlayerReplicationInfo kfRI; local KFPlayerReplicationInfo kfRI;
@ -282,9 +282,9 @@ private final function float GetPriceCorrection(
return float(Max(0, int(vanillaPrice) - int(fixPrice))); return float(Max(0, int(vanillaPrice) - int(fixPrice)));
} }
// Takes current ammo and last recorded in 'record' value to calculate // Takes current ammo and last recorded in `record` value to calculate
// how much money to take from the player // how much money to take from the player
// (calculations are done via 'GetPriceCorrection'). // (calculations are done via `GetPriceCorrection()`).
private final function WeaponRecord TaxAmmoChange(WeaponRecord record) private final function WeaponRecord TaxAmmoChange(WeaponRecord record)
{ {
local int ammoDiff; local int ammoDiff;
@ -324,7 +324,7 @@ public final function RecordAmmoPickup(Pawn pawnWithAmmo, KFAmmoPickup pickup)
{ {
local int i; local int i;
local int newAmount; local int newAmount;
// Check conditions from 'KFAmmoPickup' code ('Touch' function) // Check conditions from `KFAmmoPickup` code (`Touch()` method)
if (pickup == none) return; if (pickup == none) return;
if (pawnWithAmmo == none) return; if (pawnWithAmmo == none) return;
if (pawnWithAmmo.controller == none) return; if (pawnWithAmmo.controller == none) return;

2
sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_CamoM32Pickup.uc

@ -1,5 +1,5 @@
/** /**
* A helper class for 'FixAmmoSelling' that sets ammo cost for M32 to that * A helper class for `FixAmmoSelling` that sets ammo cost for M32 to that
* of a level 6 player and doesn't allow for a perk discount. * of a level 6 player and doesn't allow for a perk discount.
* Copyright 2019 Anton Tarasenko * Copyright 2019 Anton Tarasenko
*------------------------------------------------------------------------------ *------------------------------------------------------------------------------

2
sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_CrossbowPickup.uc

@ -1,5 +1,5 @@
/** /**
* A helper class for 'FixAmmoSelling' that sets ammo cost for xbow to that * A helper class for `FixAmmoSelling` that sets ammo cost for xbow to that
* of a level 6 player and doesn't allow for a perk discount. * of a level 6 player and doesn't allow for a perk discount.
* Copyright 2019 Anton Tarasenko * Copyright 2019 Anton Tarasenko
*------------------------------------------------------------------------------ *------------------------------------------------------------------------------

2
sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_GoldenM79Pickup.uc

@ -1,5 +1,5 @@
/** /**
* A helper class for 'FixAmmoSelling' that sets ammo cost for m79 to that * A helper class for `FixAmmoSelling` that sets ammo cost for m79 to that
* of a level 6 player and doesn't allow for a perk discount. * of a level 6 player and doesn't allow for a perk discount.
* Copyright 2019 Anton Tarasenko * Copyright 2019 Anton Tarasenko
*------------------------------------------------------------------------------ *------------------------------------------------------------------------------

2
sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_LAWPickup.uc

@ -1,5 +1,5 @@
/** /**
* A helper class for 'FixAmmoSelling' that sets ammo cost for LAW to that * A helper class for `FixAmmoSelling` that sets ammo cost for LAW to that
* of a level 6 player and doesn't allow for a perk discount. * of a level 6 player and doesn't allow for a perk discount.
* Copyright 2019 Anton Tarasenko * Copyright 2019 Anton Tarasenko
*------------------------------------------------------------------------------ *------------------------------------------------------------------------------

2
sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_M32Pickup.uc

@ -1,5 +1,5 @@
/** /**
* A helper class for 'FixAmmoSelling' that sets ammo cost for M32 to that * A helper class for `FixAmmoSelling` that sets ammo cost for M32 to that
* of a level 6 player and doesn't allow for a perk discount. * of a level 6 player and doesn't allow for a perk discount.
* Copyright 2019 Anton Tarasenko * Copyright 2019 Anton Tarasenko
*------------------------------------------------------------------------------ *------------------------------------------------------------------------------

2
sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_M79Pickup.uc

@ -1,5 +1,5 @@
/** /**
* A helper class for 'FixAmmoSelling' that sets ammo cost for M79 to that * A helper class for `FixAmmoSelling` that sets ammo cost for M79 to that
* of a level 6 player and doesn't allow for a perk discount. * of a level 6 player and doesn't allow for a perk discount.
* Copyright 2019 Anton Tarasenko * Copyright 2019 Anton Tarasenko
*------------------------------------------------------------------------------ *------------------------------------------------------------------------------

2
sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_PipeBombPickup.uc

@ -1,5 +1,5 @@
/** /**
* A helper class for 'FixAmmoSelling' that sets ammo cost for pipes * A helper class for `FixAmmoSelling` that sets ammo cost for pipes
* to that of a level 6 player and doesn't allow for a perk discount. * to that of a level 6 player and doesn't allow for a perk discount.
* Copyright 2019 Anton Tarasenko * Copyright 2019 Anton Tarasenko
*------------------------------------------------------------------------------ *------------------------------------------------------------------------------

2
sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_SPGrenadePickup.uc

@ -1,5 +1,5 @@
/** /**
* A helper class for 'FixAmmoSelling' that sets ammo cost for * A helper class for `FixAmmoSelling` that sets ammo cost for
* orca grnade launcher to that of a level 6 player * orca grnade launcher to that of a level 6 player
* and doesn't allow for a perk discount. * and doesn't allow for a perk discount.
* Copyright 2019 Anton Tarasenko * Copyright 2019 Anton Tarasenko

2
sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_SealSquealPickup.uc

@ -1,5 +1,5 @@
/** /**
* A helper class for 'FixAmmoSelling' that sets ammo cost for harpoon * A helper class for `FixAmmoSelling` that sets ammo cost for harpoon
* to that of a level 6 player and doesn't allow for a perk discount. * to that of a level 6 player and doesn't allow for a perk discount.
* Copyright 2019 Anton Tarasenko * Copyright 2019 Anton Tarasenko
*------------------------------------------------------------------------------ *------------------------------------------------------------------------------

2
sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_SeekerSixPickup.uc

@ -1,5 +1,5 @@
/** /**
* A helper class for 'FixAmmoSelling' that sets ammo cost for seeker * A helper class for `FixAmmoSelling` that sets ammo cost for seeker
* to that of a level 6 player and doesn't allow for a perk discount. * to that of a level 6 player and doesn't allow for a perk discount.
* Copyright 2019 Anton Tarasenko * Copyright 2019 Anton Tarasenko
*------------------------------------------------------------------------------ *------------------------------------------------------------------------------

4
sources/FixAmmoSelling/MutatorListener_FixAmmoSelling.uc

@ -47,8 +47,8 @@ private static function CheckAbusableWeapon(KFWeapon newWeapon)
ammoSellingFix.FixWeapon(newWeapon); ammoSellingFix.FixWeapon(newWeapon);
} }
// This function recreates the logic of 'KFWeapon.DropFrom()', // This function recreates the logic of `KFWeapon.DropFrom()`,
// since standard 'ReplaceWith' function produces bad results. // since standard `ReplaceWith()` method produces bad results.
private static function ReplaceOldPickup(Pickup oldPickup) private static function ReplaceOldPickup(Pickup oldPickup)
{ {
local Pawn instigator; local Pawn instigator;

14
sources/FixDoshSpam/FixDoshSpam.uc

@ -30,12 +30,12 @@ class FixDoshSpam extends Feature
/** /**
* First, we limit amount of dosh that can be spawned simultaneously. * First, we limit amount of dosh that can be spawned simultaneously.
* The simplest method is to place a cooldown on spawning 'CashPickup' actors, * The simplest method is to place a cooldown on spawning `CashPickup` actors,
* i.e. after spawning one 'CashPickup' we'd completely prevent spawning * i.e. after spawning one `CashPickup` we'd completely prevent spawning
* any other instances of it for a fixed amount of time. * any other instances of it for a fixed amount of time.
* However, that might allow a malicious spammer to block others from * However, that might allow a malicious spammer to block others from
* throwing dosh, - all he needs to do is to spam dosh at right time intervals. * throwing dosh, - all he needs to do is to spam dosh at right time intervals.
* We'll resolve this issue by recording how many 'CashPickup' actors * We'll resolve this issue by recording how many `CashPickup` actors
* each player has spawned as their "contribution" and decay * each player has spawned as their "contribution" and decay
* that value with time, only allowing to spawn new dosh after * that value with time, only allowing to spawn new dosh after
* contribution decayed to zero. Speed of decay is derived from current dosh * contribution decayed to zero. Speed of decay is derived from current dosh
@ -66,8 +66,8 @@ class FixDoshSpam extends Feature
var private config const float doshPerSecondLimitMax; var private config const float doshPerSecondLimitMax;
var private config const float doshPerSecondLimitMin; var private config const float doshPerSecondLimitMin;
// Amount of dosh pickups on the map at which we must set dosh per second // Amount of dosh pickups on the map at which we must set dosh per second
// to 'doshPerSecondLimitMin'. // to `doshPerSecondLimitMin`.
// We use 'doshPerSecondLimitMax' when there's no dosh on the map and // We use `doshPerSecondLimitMax` when there's no dosh on the map and
// scale linearly between them as it's amount grows. // scale linearly between them as it's amount grows.
var private config const int criticalDoshAmount; var private config const int criticalDoshAmount;
@ -139,8 +139,8 @@ private final function float GetCurrentDPSLimit()
} }
// Returns index of the contributor corresponding to the given controller. // Returns index of the contributor corresponding to the given controller.
// Returns '-1' if no connection correspond to the given controller. // Returns `-1` if no connection correspond to the given controller.
// Returns '-1' if given controller is equal to 'none'. // Returns `-1` if given controller is equal to `none`.
private final function int GetContributorIndex(PlayerController player) private final function int GetContributorIndex(PlayerController player)
{ {
local int i; local int i;

2
sources/FixDoshSpam/MutatorListener_FixDoshSpam.uc

@ -26,7 +26,7 @@ static function bool CheckReplacement(Actor other, out byte isSuperRelevant)
local FixDoshSpam doshFix; local FixDoshSpam doshFix;
local PlayerController player; local PlayerController player;
if (other.class != class'CashPickup') return true; if (other.class != class'CashPickup') return true;
// This means this dosh wasn't spawned in 'TossCash' of 'KFPawn', // This means this dosh wasn't spawned in `TossCash()` of `KFPawn`,
// so it isn't related to the exploit we're trying to fix. // so it isn't related to the exploit we're trying to fix.
if (other.instigator == none) return true; if (other.instigator == none) return true;
doshFix = FixDoshSpam(class'FixDoshSpam'.static.GetInstance()); doshFix = FixDoshSpam(class'FixDoshSpam'.static.GetInstance());

54
sources/FixDualiesCost/FixDualiesCost.uc

@ -5,7 +5,7 @@
* selling pistols in a certain way. * selling pistols in a certain way.
* *
* It fixes all of the issues by manually setting pistols' * It fixes all of the issues by manually setting pistols'
* 'SellValue' variables to proper values. * `SellValue` variables to proper values.
* Fix only works with vanilla pistols, as it's unpredictable what * Fix only works with vanilla pistols, as it's unpredictable what
* custom ones can do and they can handle these issues on their own * custom ones can do and they can handle these issues on their own
* in a better way. * in a better way.
@ -39,23 +39,23 @@ class FixDualiesCost extends Feature
* 2. When player has dual pistols and drops one on the floor, - * 2. When player has dual pistols and drops one on the floor, -
* the sell value for the one left with the player isn't set. * the sell value for the one left with the player isn't set.
* All weapons in Killing Floor get sell value assigned to them * All weapons in Killing Floor get sell value assigned to them
* (appropriately, in a 'SellValue' variable). This is to ensure that the sell * (appropriately, in a `SellValue` variable). This is to ensure that the sell
* price is set the moment players buys the gun. Otherwise, due to ridiculous * price is set the moment players buys the gun. Otherwise, due to ridiculous
* perked discounts, you'd be able to buy a pistol at 30% price * perked discounts, you'd be able to buy a pistol at 30% price
* as sharpshooter, but sell at 75% of a price as any other perk, * as sharpshooter, but sell at 75% of a price as any other perk,
* resulting in 45% of pure profit. * resulting in 45% of pure profit.
* Unfortunately, that's exactly what happens when 'SellValue' isn't set * Unfortunately, that's exactly what happens when `SellValue` isn't set
* (left as it's default value of '-1'): sell value of such weapons is * (left as it's default value of `-1`): sell value of such weapons is
* determined only at the moment of sale and depends on the perk of the seller, * determined only at the moment of sale and depends on the perk of the seller,
* allowing for possible exploits. * allowing for possible exploits.
* *
* These issues are fixed by directly assigning * These issues are fixed by directly assigning
* proper values to 'SellValue'. To do that we need to detect when player * proper values to `SellValue`. To do that we need to detect when player
* buys/sells/drops/picks up weapons, which we accomplish by catching * buys/sells/drops/picks up weapons, which we accomplish by catching
* 'CheckReplacement' event for weapon instances. This approach has two issues. * `CheckReplacement()` event for weapon instances. This approach has two issues.
* One is that, if vanilla's code sets an incorrect sell value, - * One is that, if vanilla's code sets an incorrect sell value, -
* it's doing it after weapon is spawned and, therefore, * it's doing it after weapon is spawned and, therefore,
* after 'CheckReplacement' call, so we have, instead, to remember to do * after `CheckReplacement()` call, so we have, instead, to remember to do
* it later, as early as possible * it later, as early as possible
* (either the next tick or before another operation with weapons). * (either the next tick or before another operation with weapons).
* Another issue is that when you have a pistol and pick up a pistol of * Another issue is that when you have a pistol and pick up a pistol of
@ -68,13 +68,13 @@ class FixDualiesCost extends Feature
* player can start touching them (which triggers a pickup) at the same time, * player can start touching them (which triggers a pickup) at the same time,
* picking them both in a single tick. This leaves us no room to record * picking them both in a single tick. This leaves us no room to record
* the value of a single pistol players picks up first. * the value of a single pistol players picks up first.
* To get it we use game rules to catch 'OverridePickupQuery' event that's * To get it we use game rules to catch `OverridePickupQuery` event that's
* called before the first one gets destroyed, * called before the first one gets destroyed,
* but after it's sell value was already set. * but after it's sell value was already set.
* Last issue is that when player picks up a second pistol - we don't know * Last issue is that when player picks up a second pistol - we don't know
* it's sell value and, therefore, can't calculate value of dual pistols. * it's sell value and, therefore, can't calculate value of dual pistols.
* This is resolved by recording that value directly from a pickup, * This is resolved by recording that value directly from a pickup,
* in abovementioned function 'OverridePickupQuery'. * in abovementioned function `OverridePickupQuery`.
* NOTE: 9mm is an exception due to the fact that you always have at least * NOTE: 9mm is an exception due to the fact that you always have at least
* one and the last one can't be sold. We'll deal with it by setting * one and the last one can't be sold. We'll deal with it by setting
* the following rule: sell value of the un-droppable pistol is always 0 * the following rule: sell value of the un-droppable pistol is always 0
@ -110,7 +110,7 @@ class FixDualiesCost extends Feature
// These people are, without a question, complete degenerates. // These people are, without a question, complete degenerates.
// But making mods for only non-mentally challenged isn't inclusive. // But making mods for only non-mentally challenged isn't inclusive.
// So we add this option. // So we add this option.
// Set it to 'false' if you only want to fix ammo printing // Set it to `false` if you only want to fix ammo printing
// and leave the rest of the bullshit as-is. // and leave the rest of the bullshit as-is.
var private config const bool allowSellValueIncrease; var private config const bool allowSellValueIncrease;
@ -137,13 +137,13 @@ struct WeaponDataRecord
var class<KFWeapon> class; var class<KFWeapon> class;
var float value; var float value;
// The whole point of this structure is to remember value of a weapon // The whole point of this structure is to remember value of a weapon
// after it's destroyed. Since 'reference' will become 'none' by then, // after it's destroyed. Since `reference` will become `none` by then,
// we will use the 'owner' reference to identify the weapon. // we will use the `owner` reference to identify the weapon.
var Pawn owner; var Pawn owner;
}; };
var private const array<WeaponDataRecord> storedValues; var private const array<WeaponDataRecord> storedValues;
// Sell value of the last seen pickup in 'OverridePickupQuery' // Sell value of the last seen pickup in `OverridePickupQuery`
var private int nextSellValue; var private int nextSellValue;
protected function OnEnabled() protected function OnEnabled()
@ -189,8 +189,8 @@ public final function SetNextSellValue(int newValue)
nextSellValue = newValue; nextSellValue = newValue;
} }
// Finds a weapon of a given class in given 'Pawn' 's inventory. // Finds a weapon of a given class in given `Pawn`'s inventory.
// Returns 'none' if weapon isn't there. // Returns `none` if weapon isn't there.
private final function KFWeapon GetWeaponOfClass( private final function KFWeapon GetWeaponOfClass(
Pawn playerPawn, Pawn playerPawn,
class<KFWeapon> weaponClass class<KFWeapon> weaponClass
@ -213,9 +213,9 @@ private final function KFWeapon GetWeaponOfClass(
// Gets weapon index in our record of dual pistol classes. // Gets weapon index in our record of dual pistol classes.
// Second variable determines whether we're searching for single // Second variable determines whether we're searching for single
// or dual variant: // or dual variant:
// ~ 'true' - searching for single // ~ `true` - searching for single
// ~ 'false' - for dual // ~ `false` - for dual
// Returns '-1' if weapon isn't found // Returns `-1` if weapon isn't found
// (dual MK23 won't be found as a single weapon). // (dual MK23 won't be found as a single weapon).
private final function int GetIndexAs(KFWeapon weapon, bool asSingle) private final function int GetIndexAs(KFWeapon weapon, bool asSingle)
{ {
@ -296,9 +296,9 @@ public final function FixCostAfterThrow(KFWeapon singlePistol)
dualiesClasses[index].dual); dualiesClasses[index].dual);
if (dualPistols == none) return; if (dualPistols == none) return;
// Sell value recorded into 'dualPistols' will end up as a value of // Sell value recorded into `dualPistols` will end up as a value of
// a dropped pickup. // a dropped pickup.
// Sell value of 'singlePistol' will be the value for the pistol, // Sell value of `singlePistol` will be the value for the pistol,
// left in player's hands. // left in player's hands.
if (dualPistols.class == class'KFMod.Single') if (dualPistols.class == class'KFMod.Single')
{ {
@ -328,8 +328,8 @@ public final function FixCostAfterBuying(KFWeapon dualPistols)
dualiesClasses[index].single); dualiesClasses[index].single);
if (singlePistol == none) return; if (singlePistol == none) return;
// 'singlePistol' will get destroyed, so it's sell value is irrelevant. // `singlePistol` will get destroyed, so it's sell value is irrelevant.
// 'dualPistols' will be the new pair of pistols, but it's value will // `dualPistols` will be the new pair of pistols, but it's value will
// get overwritten by vanilla's code after this function. // get overwritten by vanilla's code after this function.
// So we must add it to pending values to be changed later. // So we must add it to pending values to be changed later.
newPendingValue.weapon = dualPistols; newPendingValue.weapon = dualPistols;
@ -343,8 +343,8 @@ public final function FixCostAfterBuying(KFWeapon dualPistols)
else else
{ {
// Otherwise price of a pair is the price of two pistols: // Otherwise price of a pair is the price of two pistols:
// 'singlePistol.sellValue' - the one we had // `singlePistol.sellValue` - the one we had
// '(FullCost / 2) * 0.75' - and the one we bought // `(FullCost / 2) * 0.75` - and the one we bought
newPendingValue.value = singlePistol.sellValue newPendingValue.value = singlePistol.sellValue
+ (GetFullCost(dualPistols) / 2) * 0.75; + (GetFullCost(dualPistols) / 2) * 0.75;
} }
@ -364,12 +364,12 @@ public final function FixCostAfterPickUp(KFWeapon dualPistols)
// 1. buying dualies, without having a single pistol of // 1. buying dualies, without having a single pistol of
// corresponding type; // corresponding type;
// 2. picking up a second pistol, while having another one; // 2. picking up a second pistol, while having another one;
// by the time of 'CheckReplacement' (and, therefore, this function) // by the time of `CheckReplacement()` (and, therefore, this function)
// is called, there's no longer any single pistol in player's inventory // is called, there's no longer any single pistol in player's inventory
// (in first case it never was there, in second - it got destroyed). // (in first case it never was there, in second - it got destroyed).
// To distinguish between those possibilities we can check the owner of // To distinguish between those possibilities we can check the owner of
// the spawned weapon, since it's only set to instigator at the time of // the spawned weapon, since it's only set to instigator at the time of
// 'CheckReplacement' when player picks up a weapon. // `CheckReplacement()` when player picks up a weapon.
// So we require that owner exists. // So we require that owner exists.
if (dualPistols.owner == none) return; if (dualPistols.owner == none) return;
index = GetIndexAs(dualPistols, false); index = GetIndexAs(dualPistols, false);
@ -399,7 +399,7 @@ public final function ApplyPendingValues()
for (i = 0; i < pendingValues.length; i += 1) for (i = 0; i < pendingValues.length; i += 1)
{ {
if (pendingValues[i].weapon == none) continue; if (pendingValues[i].weapon == none) continue;
// Our fixes can only increase the correct ('!= -1') // Our fixes can only increase the correct (`!= -1`)
// sell value of weapons, so if we only need to change sell value // sell value of weapons, so if we only need to change sell value
// if we're allowed to increase it or it's incorrect. // if we're allowed to increase it or it's incorrect.
if (allowSellValueIncrease || pendingValues[i].weapon.sellValue == -1) { if (allowSellValueIncrease || pendingValues[i].weapon.sellValue == -1) {

2
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.

13
sources/FixFFHack/FixFFHack.uc

@ -35,12 +35,12 @@ class FixFFHack extends Feature
* To specify required subset of weapons, one must first * To specify required subset of weapons, one must first
* chose a general rule (scale by default / don't scale by default) and then, * chose a general rule (scale by default / don't scale by default) and then,
* optionally, add exceptions to it. * optionally, add exceptions to it.
* Choosing 'scaleByDefault == true' as a general rule will make this fix * Choosing `scaleByDefault == true` as a general rule will make this fix
* behave in the similar way to 'KFExplosiveFix' by mutant and will disable * behave in the similar way to `KFExplosiveFix` by mutant and will disable
* some environmental sources of damage on some maps. One can then add relevant * some environmental sources of damage on some maps. One can then add relevant
* damage classes as exceptions to fix that downside, but making an extensive * damage classes as exceptions to fix that downside, but making an extensive
* list of such sources might prove problematic. * list of such sources might prove problematic.
* On the other hand, setting 'scaleByDefault == false' will allow to get * On the other hand, setting `scaleByDefault == false` will allow to get
* rid of team-killing exploits by simply adding damage types of all * rid of team-killing exploits by simply adding damage types of all
* projectile weapons, used on a server. This fix comes with such filled-in * projectile weapons, used on a server. This fix comes with such filled-in
* list of all vanilla projectile classes. * list of all vanilla projectile classes.
@ -48,9 +48,10 @@ class FixFFHack extends Feature
// Defines a general rule for choosing whether or not to apply // Defines a general rule for choosing whether or not to apply
// friendly fire scaling. // friendly fire scaling.
// This can be overwritten by exceptions ('alwaysScale' or 'neverScale'). // This can be overwritten by exceptions (`alwaysScale` or `neverScale`).
// Enabling scaling by default without any exceptions in 'neverScale' will // Enabling scaling by default without any exceptions in `neverScale` will
// make this fix behave almost identically to Mutant's 'Explosives Fix Mutator'. // make this fix behave almost identically to Mutant's
// 'Explosives Fix Mutator'.
var private config const bool scaleByDefault; var private config const bool scaleByDefault;
// Damage types, for which we should always reapply friendly fire scaling. // Damage types, for which we should always reapply friendly fire scaling.
var private config const array< class<DamageType> > alwaysScale; var private config const array< class<DamageType> > alwaysScale;

38
sources/FixInfiniteNades/FixInfiniteNades.uc

@ -1,5 +1,5 @@
/** /**
* This feature fixes a vulnerability in a code of 'Frag' that can allow * This feature fixes a vulnerability in a code of `Frag` that can allow
* player to throw grenades even when he no longer has any. * player to throw grenades even when he no longer has any.
* There's also no cooldowns on the throw, which can lead to a server crash. * There's also no cooldowns on the throw, which can lead to a server crash.
* Copyright 2019 Anton Tarasenko * Copyright 2019 Anton Tarasenko
@ -23,7 +23,7 @@ class FixInfiniteNades extends Feature
config(AcediaFixes); config(AcediaFixes);
/** /**
* It is possible to call 'ServerThrow' function from client, * It is possible to call `ServerThrow` function from client,
* forcing it to get executed on a server. This function consumes the grenade * forcing it to get executed on a server. This function consumes the grenade
* ammo and spawns a nade, but it doesn't check if player had any grenade ammo * ammo and spawns a nade, but it doesn't check if player had any grenade ammo
* in the first place, allowing you him to throw however many grenades * in the first place, allowing you him to throw however many grenades
@ -31,7 +31,7 @@ class FixInfiniteNades extends Feature
* allows to spawn many grenades without any delay, * allows to spawn many grenades without any delay,
* which can lead to a server crash. * which can lead to a server crash.
* *
* This fix tracks every instance of 'Frag' weapon that's responsible for * This fix tracks every instance of `Frag` weapon that's responsible for
* throwing grenades and records how much ammo they have have. * throwing grenades and records how much ammo they have have.
* This is necessary, because whatever means we use, when we get a say in * This is necessary, because whatever means we use, when we get a say in
* preventing grenade from spawning the ammo was already reduced. * preventing grenade from spawning the ammo was already reduced.
@ -40,18 +40,18 @@ class FixInfiniteNades extends Feature
* his last nade, as in both cases current ammo visible to us will be 0. * his last nade, as in both cases current ammo visible to us will be 0.
* Then, before every nade throw, it checks if player has enough ammo and * Then, before every nade throw, it checks if player has enough ammo and
* blocks grenade from spawning if he doesn't. * blocks grenade from spawning if he doesn't.
* We change a 'FireModeClass[0]' from 'FragFire' to 'FixedFragFire' and * We change a `FireModeClass[0]` from `FragFire` to `FixedFragFire` and
* only call 'super.DoFireEffect()' if we decide spawning grenade * only call `super.DoFireEffect()` if we decide spawning grenade
* should be allowed. The side effect is a change in server's 'FireModeClass'. * should be allowed. The side effect is a change in server's `FireModeClass`.
*/ */
// Setting this flag to 'true' will allow to throw grenades by calling // Setting this flag to `true` will allow to throw grenades by calling
// 'ServerThrow' directly, as long as player has necessary ammo. // `ServerThrow()` directly, as long as player has necessary ammo.
// This can allow some players to throw grenades much quicker than intended, // This can allow some players to throw grenades much quicker than intended,
// so if you wish to prevent it, keep this flag set to `false`. // so if you wish to prevent it, keep this flag set to `false`.
var private config const bool ignoreTossFlags; var private config const bool ignoreTossFlags;
// Records how much ammo given frag grenade ('Frag') has. // Records how much ammo given frag grenade (`Frag`) has.
struct FragAmmoRecord struct FragAmmoRecord
{ {
var public Frag fragReference; var public Frag fragReference;
@ -77,8 +77,8 @@ protected function OnDisabled()
} }
// Returns index of the connection corresponding to the given controller. // Returns index of the connection corresponding to the given controller.
// Returns '-1' if no connection correspond to the given controller. // Returns `-1` if no connection correspond to the given controller.
// Returns '-1' if given controller is equal to 'none'. // Returns `-1` if given controller is equal to `none`.
private final function int GetAmmoIndex(Frag fragToCheck) private final function int GetAmmoIndex(Frag fragToCheck)
{ {
local int i; local int i;
@ -94,7 +94,7 @@ private final function int GetAmmoIndex(Frag fragToCheck)
return -1; return -1;
} }
// Recreates all the 'Frag' actors, to change their fire mode mid-game. // Recreates all the `Frag` actors, to change their fire mode mid-game.
private final function RecreateFrags() private final function RecreateFrags()
{ {
local int i; local int i;
@ -105,7 +105,7 @@ private final function RecreateFrags()
oldRecords = ammoRecords; oldRecords = ammoRecords;
for (i = 0; i < oldRecords.length; i += 1) for (i = 0; i < oldRecords.length; i += 1)
{ {
// Check if we even need to recreate that instance of 'Frag' // Check if we even need to recreate that instance of `Frag`
if (oldRecords[i].fragReference == none) continue; if (oldRecords[i].fragReference == none) continue;
fragOwner = oldRecords[i].fragReference.instigator; fragOwner = oldRecords[i].fragReference.instigator;
if (fragOwner == none) continue; if (fragOwner == none) continue;
@ -122,7 +122,7 @@ private final function RecreateFrags()
} }
} }
// Utility function to help find a 'Frag' instance in a given pawn's inventory. // Utility function to help find a `Frag` instance in a given pawn's inventory.
static private final function Frag GetPawnFrag(Pawn pawnWithFrag) static private final function Frag GetPawnFrag(Pawn pawnWithFrag)
{ {
local Frag foundFrag; local Frag foundFrag;
@ -152,7 +152,7 @@ private final function int GetFragAmmo(Frag fragReference)
return Int(currentAmmo); return Int(currentAmmo);
} }
// Attempts to add new 'Frag' instance to our records. // Attempts to add new `Frag` instance to our records.
public final function RegisterFrag(Frag newFrag) public final function RegisterFrag(Frag newFrag)
{ {
local int index; local int index;
@ -166,8 +166,8 @@ public final function RegisterFrag(Frag newFrag)
} }
// This function tells our fix that there was a nade throw and we should // This function tells our fix that there was a nade throw and we should
// reduce current 'Frag' ammo in our records. // reduce current `Frag` ammo in our records.
// Returns 'true' if we had ammo for that, and 'false' if we didn't. // Returns `true` if we had ammo for that, and `false` if we didn't.
public final function bool RegisterNadeThrow(Frag relevantFrag) public final function bool RegisterNadeThrow(Frag relevantFrag)
{ {
if (CanThrowGrenade(relevantFrag)) if (CanThrowGrenade(relevantFrag))
@ -181,8 +181,8 @@ public final function bool RegisterNadeThrow(Frag relevantFrag)
// Can we throw grenade according to our rules? // Can we throw grenade according to our rules?
// A throw can be prevented if: // A throw can be prevented if:
// - we think that player doesn't have necessary ammo; // - we think that player doesn't have necessary ammo;
// - Player isn't currently 'tossing' a nade, // - Player isn't currently `tossing` a nade,
// meaning it was a direct call of 'ServerThrow'. // meaning it was a direct call of `ServerThrow`.
private final function bool CanThrowGrenade(Frag fragToCheck) private final function bool CanThrowGrenade(Frag fragToCheck)
{ {
local int index; local int index;

4
sources/FixInfiniteNades/FixedFragFire.uc

@ -1,7 +1,7 @@
/** /**
* A replacement for vanilla 'FragFire' fire class for 'Frag' weapon that * A replacement for vanilla `FragFire` fire class for `Frag` weapon that
* adds additional ammo check in accordance to ammo records * adds additional ammo check in accordance to ammo records
* of 'FixInfiniteNades'. * of `FixInfiniteNades`.
* Copyright 2019 Anton Tarasenko * Copyright 2019 Anton Tarasenko
*------------------------------------------------------------------------------ *------------------------------------------------------------------------------
* This file is part of Acedia. * This file is part of Acedia.

2
sources/FixInfiniteNades/MutatorListener_FixInfiniteNades.uc

@ -1,6 +1,6 @@
/** /**
* Overloaded mutator events listener to catch * Overloaded mutator events listener to catch
* new 'Frag' weapons and 'Nade' projectiles. * new `Frag` weapons and `Nade` projectiles.
* Copyright 2019 Anton Tarasenko * Copyright 2019 Anton Tarasenko
*------------------------------------------------------------------------------ *------------------------------------------------------------------------------
* This file is part of Acedia. * This file is part of Acedia.

8
sources/FixInventoryAbuse/FixInventoryAbuse.uc

@ -105,8 +105,8 @@ private final function class<KFWeaponPickup> GetRootPickupClass(KFWeapon weapon)
return root; return root;
} }
// Returns 'true' if passed pawn has two weapons that are just variants of // Returns `true` if passed pawn has two weapons that are just variants of
// each other (they have the same root, see 'GetRootPickupClass'). // each other (they have the same root, see `GetRootPickupClass()`).
private final function bool HasDuplicateGuns(KFHumanPawn playerPawn) private final function bool HasDuplicateGuns(KFHumanPawn playerPawn)
{ {
local int i, j; local int i, j;
@ -150,11 +150,11 @@ private final function Vector DropWeapon(KFWeapon weaponToDrop)
playerPawn = KFHumanPawn(weaponToDrop.instigator); playerPawn = KFHumanPawn(weaponToDrop.instigator);
if (playerPawn == none) return Vect(0, 0, 0); if (playerPawn == none) return Vect(0, 0, 0);
// Calculations from 'PlayerController.ServerThrowWeapon' // Calculations from `PlayerController.ServerThrowWeapon()`
weaponVelocity = Vector(playerPawn.GetViewRotation()); weaponVelocity = Vector(playerPawn.GetViewRotation());
weaponVelocity *= (playerPawn.velocity dot weaponVelocity) + 150; weaponVelocity *= (playerPawn.velocity dot weaponVelocity) + 150;
weaponVelocity += Vect(0, 0, 100); weaponVelocity += Vect(0, 0, 100);
// Calculations from 'Pawn.TossWeapon' // Calculations from `Pawn.TossWeapon()`
GetAxes(playerPawn.rotation, x, y, z); GetAxes(playerPawn.rotation, x, y, z);
dropLocation = playerPawn.location + 0.8 * playerPawn.collisionRadius * x - dropLocation = playerPawn.location + 0.8 * playerPawn.collisionRadius * x -
0.5 * playerPawn.collisionRadius * y; 0.5 * playerPawn.collisionRadius * y;

3
sources/FixPipes/FixPipes.uc

@ -243,6 +243,7 @@ private final function InterceptProximityChecks()
if (IsPipeDoingProximityChecks(pipeRecords[i].pipe)) if (IsPipeDoingProximityChecks(pipeRecords[i].pipe))
{ {
pipeRecords[i].pipe.SetTimer(0, false); pipeRecords[i].pipe.SetTimer(0, false);
// We set `1.0` because that is the vanilla value;
// Line 123 of "PipeBombProjectile.uc": `SetTimer(1.0,True);` // Line 123 of "PipeBombProjectile.uc": `SetTimer(1.0,True);`
pipeRecords[i].timerCountDown = 1.0; pipeRecords[i].timerCountDown = 1.0;
pipeRecords[i].proximityCheckIntercepted = true; pipeRecords[i].proximityCheckIntercepted = true;
@ -259,7 +260,7 @@ private final function bool IsPipeDoingProximityChecks(PipeBombProjectile pipe)
if (pipe.bHidden) return false; if (pipe.bHidden) return false;
if (pipe.bTriggered) return false; if (pipe.bTriggered) return false;
if (pipe.bEnemyDetected) return false; if (pipe.bEnemyDetected) return false;
return (pipe.ArmingCountDown < 0); return (pipe.armingCountDown < 0);
} }
// Checks what pipes have their timers run out and doing proximity checks // Checks what pipes have their timers run out and doing proximity checks

42
sources/FixSpectatorCrash/FixSpectatorCrash.uc

@ -29,7 +29,7 @@ class FixSpectatorCrash extends Feature
/** /**
* We use broadcast events to track when someone is switching * We use broadcast events to track when someone is switching
* to active player or spectator and remember such people * to active player or spectator and remember such people
* for a short time (cooldown), defined by ('spectatorChangeTimeout'). * for a short time (cooldown), defined by (`spectatorChangeTimeout`).
* If one of the player we've remembered tries to switch again, * If one of the player we've remembered tries to switch again,
* before the defined cooldown ran out, - we kick him * before the defined cooldown ran out, - we kick him
* by destroying his controller. * by destroying his controller.
@ -37,7 +37,7 @@ class FixSpectatorCrash extends Feature
* immediately destroyed and instead initiate player disconnection, - * immediately destroyed and instead initiate player disconnection, -
* exploiter might have enough time to cause a lag or even crash the server. * exploiter might have enough time to cause a lag or even crash the server.
* We address this issue by temporarily blocking anyone from * We address this issue by temporarily blocking anyone from
* becoming active player (we do this by setting 'numPlayers' variable in * becoming active player (we do this by setting `numPlayers` variable in
* killing floor's game info to a large value). * killing floor's game info to a large value).
* After all malicious players have successfully disconnected, - * After all malicious players have successfully disconnected, -
* we remove the block. * we remove the block.
@ -45,7 +45,7 @@ class FixSpectatorCrash extends Feature
// This fix will try to kick any player that switches between active player // This fix will try to kick any player that switches between active player
// and cooldown faster than time (in seconds) in this value. // and cooldown faster than time (in seconds) in this value.
// NOTE: raising this value past default value of '0.25' // NOTE: raising this value past default value of `0.25`
// won't actually improve crash prevention. // won't actually improve crash prevention.
var private config const float spectatorChangeTimeout; var private config const float spectatorChangeTimeout;
@ -53,14 +53,14 @@ var private config const float spectatorChangeTimeout;
// Allows you to turn off server blocking. // Allows you to turn off server blocking.
// Players that don't respect timeout will still be kicked. // Players that don't respect timeout will still be kicked.
// This might be needed if this fix conflicts with another mutator // This might be needed if this fix conflicts with another mutator
// that also changes 'numPlayers'. // that also changes `numPlayers`.
// However, it is necessary to block aggressive enough server crash attempts, // However, it is necessary to block aggressive enough server crash attempts,
// but can cause compatibility issues with some mutators. // but can cause compatibility issues with some mutators.
// It's highly preferred to rewrite such a mutator to be compatible. // It's highly preferred to rewrite such a mutator to be compatible.
// NOTE: it should be compatible with most faked players-type mutators, // NOTE: it should be compatible with most faked players-type mutators,
// since this fix remembers the difference between amount of // since this fix remembers the difference between amount of
// real players and 'numPlayers'. // real players and `numPlayers`.
// After unblocking, it sets 'numPlayers' to // After unblocking, it sets `numPlayers` to
// the current amount of real players + that difference. // the current amount of real players + that difference.
// So 4 players + 3 (=7 numPlayers) after kicking 1 player becomes // So 4 players + 3 (=7 numPlayers) after kicking 1 player becomes
// 3 players + 3 (=6 numPlayers). // 3 players + 3 (=6 numPlayers).
@ -86,18 +86,18 @@ var private array<PlayerController> violators;
// Is server currently blocked? // Is server currently blocked?
var private bool becomingActiveBlocked; var private bool becomingActiveBlocked;
// This value introduced to accommodate mods such as faked player that can // This value introduced to accommodate mods such as faked player that can
// change 'numPlayers' to a value that isn't directly tied to the // change `numPlayers` to a value that isn't directly tied to the
// current number of active players. // current number of active players.
// We remember the difference between active players and 'numPlayers' // We remember the difference between active players and `numPlayers`
/// variable in game type before server block and add it after block is over. /// variable in game type before server block and add it after block is over.
// If some mod introduces a more complicated relation between amount of // If some mod introduces a more complicated relation between amount of
// active players and 'numPlayers', then it must take care of // active players and `numPlayers`, then it must take care of
// compatibility on it's own. // compatibility on it's own.
var private int recordedNumPlayersMod; var private int recordedNumPlayersMod;
// If given 'PlayerController' is registered in our cooldown records, - // If given `PlayerController` is registered in our cooldown records, -
// returns it's index. // returns it's index.
// If it doesn't exists (or 'none' value was passes), - returns '-1'. // If it doesn't exists (or `none` value was passes), - returns `-1`.
private final function int GetCooldownIndex(PlayerController player) private final function int GetCooldownIndex(PlayerController player)
{ {
local int i; local int i;
@ -112,8 +112,8 @@ private final function int GetCooldownIndex(PlayerController player)
return -1; return -1;
} }
// Checks if given 'PlayerController' is registered as a violator. // Checks if given `PlayerController` is registered as a violator.
// 'none' value isn't a violator. // `none` value isn't a violator.
public final function bool IsViolator(PlayerController player) public final function bool IsViolator(PlayerController player)
{ {
local int i; local int i;
@ -130,7 +130,7 @@ public final function bool IsViolator(PlayerController player)
// This function is to notify our fix that some player just changed status // This function is to notify our fix that some player just changed status
// of active player / spectator. // of active player / spectator.
// If passes value isn't 'none', it puts given player on cooldown or kicks him. // If passes value isn't `none`, it puts given player on cooldown or kicks him.
public final function NotifyStatusChange(PlayerController player) public final function NotifyStatusChange(PlayerController player)
{ {
local int index; local int index;
@ -159,15 +159,15 @@ public final function NotifyStatusChange(PlayerController player)
} }
} }
// Pass 'true' to block server, 'false' to unblock. // Pass `true` to block server, `false` to unblock.
// Only works if 'allowServerBlock' is set to 'true'. // Only works if `allowServerBlock` is set to `true`.
private final function SetBlock(bool activateBlock) private final function SetBlock(bool activateBlock)
{ {
local KFGameType kfGameType; local KFGameType kfGameType;
// Do we even need to do anything? // Do we even need to do anything?
if (!allowServerBlock) return; if (!allowServerBlock) return;
if (activateBlock == becomingActiveBlocked) return; if (activateBlock == becomingActiveBlocked) return;
// Only works with 'KFGameType' and it's children. // Only works with `KFGameType` and it's children.
if (level != none) kfGameType = KFGameType(level.game); if (level != none) kfGameType = KFGameType(level.game);
if (kfGameType == none) return; if (kfGameType == none) return;
@ -177,13 +177,13 @@ private final function SetBlock(bool activateBlock)
{ {
recordedNumPlayersMod = GetNumPlayersMod(); recordedNumPlayersMod = GetNumPlayersMod();
// This value both can't realistically fall below // This value both can't realistically fall below
// 'kfGameType.maxPlayer' and won't overflow from random increase // `kfGameType.maxPlayer` and won't overflow from random increase
// in vanilla code. // in vanilla code.
kfGameType.numPlayers = maxInt / 2; kfGameType.numPlayers = maxInt / 2;
} }
else else
{ {
// Adding 'recordedNumPlayersMod' should prevent // Adding `recordedNumPlayersMod` should prevent
// faked players from breaking. // faked players from breaking.
kfGameType.numPlayers = GetRealPlayers() + recordedNumPlayersMod; kfGameType.numPlayers = GetRealPlayers() + recordedNumPlayersMod;
} }
@ -207,7 +207,7 @@ private final function TryUnblocking()
// Counts current amount of "real" active players // Counts current amount of "real" active players
// (connected to the server and not spectators). // (connected to the server and not spectators).
// Need 'ConnectionService' to be running, otherwise return '-1'. // Need `ConnectionService` to be running, otherwise return `-1`.
private final function int GetRealPlayers() private final function int GetRealPlayers()
{ {
// Auxiliary variables // Auxiliary variables
@ -236,7 +236,7 @@ private final function int GetRealPlayers()
} }
// Calculates difference between current amount of "real" active players // Calculates difference between current amount of "real" active players
// and 'numPlayers' from 'KFGameType'. // and `numPlayers` from `KFGameType`.
// Most typically this difference will be non-zero when using // Most typically this difference will be non-zero when using
// faked players-type mutators // faked players-type mutators
// (difference will be equal to the amount of faked players). // (difference will be equal to the amount of faked players).

26
sources/FixZedTimeLags/FixZedTimeLags.uc

@ -2,9 +2,9 @@
* This feature fixes lags caused by a zed time that can occur * This feature fixes lags caused by a zed time that can occur
* on some maps when a lot of zeds are present at once. * on some maps when a lot of zeds are present at once.
* As a side effect it also fixes an issue where during zed time speed up * As a side effect it also fixes an issue where during zed time speed up
* 'zedTimeSlomoScale' was assumed to be default value of '0.2'. * `zedTimeSlomoScale` was assumed to be default value of `0.2`.
* Now zed time will behave correctly with mods that * Now zed time will behave correctly with mods that
* change 'zedTimeSlomoScale'. * change `zedTimeSlomoScale`.
* Copyright 2020 Anton Tarasenko * Copyright 2020 Anton Tarasenko
*------------------------------------------------------------------------------ *------------------------------------------------------------------------------
* This file is part of Acedia. * This file is part of Acedia.
@ -28,20 +28,20 @@ class FixZedTimeLags extends Feature
/** /**
* When zed time activates, game speed is immediately set to * When zed time activates, game speed is immediately set to
* 'zedTimeSlomoScale' (0.2 by default), defined, like all other variables, * `zedTimeSlomoScale` (0.2 by default), defined, like all other variables,
* in 'KFGameType'. Zed time lasts 'zedTimeDuration' seconds (3.0 by default), * in `KFGameType`. Zed time lasts `zedTimeDuration` seconds (3.0 by default),
* but during last 'zedTimeDuration * 0.166' seconds (by default 0.498) * but during last `zedTimeDuration * 0.166` seconds (by default 0.498)
* it starts to speed back up, causing game speed to update every tick. * it starts to speed back up, causing game speed to update every tick.
* This makes animations look more smooth when exiting zed-time; * This makes animations look more smooth when exiting zed-time;
* however, updating speed every tick for that purpose seems like * however, updating speed every tick for that purpose seems like
* an overkill and, combined with things like * an overkill and, combined with things like
* increased tick rate, certain maps and raised zed limit, * increased tick rate, certain maps and raised zed limit,
* it can lead to noticeable lags at the end of zed time. * it can lead to noticeable lags at the end of zed time.
* To fix this issue we disable 'Tick' event in * To fix this issue we disable `Tick()` event in
* 'KFGameType' and then repeat that functionality in our own 'Tick' event, * `KFGameType` and then repeat that functionality in our own `Tick()` event,
* but only perform game speed updates occasionally, * but only perform game speed updates occasionally,
* to make sure that overall amount of updates won't go over a limit, * to make sure that overall amount of updates won't go over a limit,
* that can be configured via 'maxGameSpeedUpdatesAmount' * that can be configured via `maxGameSpeedUpdatesAmount`
* Author's test (looking really hard on clots' animations) * Author's test (looking really hard on clots' animations)
* seem to suggest that there shouldn't be much visible difference if * seem to suggest that there shouldn't be much visible difference if
* we limit game speed updates to about 2 or 3. * we limit game speed updates to about 2 or 3.
@ -54,12 +54,12 @@ class FixZedTimeLags extends Feature
// Values lower than 1 are treated like 1. // Values lower than 1 are treated like 1.
var private config const int maxGameSpeedUpdatesAmount; var private config const int maxGameSpeedUpdatesAmount;
// [ADVANCED] Don't change this setting unless you know what you're doing. // [ADVANCED] Don't change this setting unless you know what you're doing.
// Compatibility setting that allows to keep 'GameInfo' 's 'Tick' event // Compatibility setting that allows to keep `GameInfo`'s `Tick()` event
// from being disabled. // from being disabled.
// Useful when running Acedia along with custom 'GameInfo' // Useful when running Acedia along with custom `GameInfo`
// (that isn't 'KFGameType') that relies on 'Tick' event. // (that isn't `KFGameType`) that relies on `Tick()` event.
// Note, however, that in order to keep this fix working properly, // Note, however, that in order to keep this fix working properly,
// it's on you to make sure 'KFGameType.Tick()' logic isn't executed. // it's on you to make sure `KFGameType.Tick()` logic isn't executed.
var private config const bool disableTick; var private config const bool disableTick;
// Counts how much time is left until next update // Counts how much time is left until next update
var private float updateCooldown; var private float updateCooldown;
@ -145,7 +145,7 @@ private final function TellClientsZedTimeEnds()
// gradual game speed increase. // gradual game speed increase.
private final function DoSpeedBackUp(float trueTimePassed) private final function DoSpeedBackUp(float trueTimePassed)
{ {
// Game speed will always be updated in our 'Tick' event // Game speed will always be updated in our `Tick()` event
// at the very end of the zed time. // at the very end of the zed time.
// The rest of the updates will be uniformly distributed // The rest of the updates will be uniformly distributed
// over the speed up duration. // over the speed up duration.

Loading…
Cancel
Save