From aacadf6c7c1c9115c0b420da58cfc00c36841c85 Mon Sep 17 00:00:00 2001 From: Anton Tarasenko Date: Mon, 8 Mar 2021 19:47:45 +0700 Subject: [PATCH] Fix code/comment style --- config/AcediaFixes.ini | 50 ++++++++--------- sources/FixAmmoSelling/AmmoPickupStalker.uc | 6 +-- sources/FixAmmoSelling/FixAmmoSelling.uc | 40 +++++++------- .../FixAmmoSellingClass_CamoM32Pickup.uc | 2 +- .../FixAmmoSellingClass_CrossbowPickup.uc | 2 +- .../FixAmmoSellingClass_GoldenM79Pickup.uc | 2 +- .../FixAmmoSellingClass_LAWPickup.uc | 2 +- .../FixAmmoSellingClass_M32Pickup.uc | 2 +- .../FixAmmoSellingClass_M79Pickup.uc | 2 +- .../FixAmmoSellingClass_PipeBombPickup.uc | 2 +- .../FixAmmoSellingClass_SPGrenadePickup.uc | 2 +- .../FixAmmoSellingClass_SealSquealPickup.uc | 2 +- .../FixAmmoSellingClass_SeekerSixPickup.uc | 2 +- .../MutatorListener_FixAmmoSelling.uc | 4 +- sources/FixDoshSpam/FixDoshSpam.uc | 14 ++--- .../MutatorListener_FixDoshSpam.uc | 2 +- sources/FixDualiesCost/FixDualiesCost.uc | 54 +++++++++---------- sources/FixFFHack/FFHackRule.uc | 2 +- sources/FixFFHack/FixFFHack.uc | 13 ++--- sources/FixInfiniteNades/FixInfiniteNades.uc | 38 ++++++------- sources/FixInfiniteNades/FixedFragFire.uc | 4 +- .../MutatorListener_FixInfiniteNades.uc | 2 +- .../FixInventoryAbuse/FixInventoryAbuse.uc | 8 +-- sources/FixPipes/FixPipes.uc | 3 +- .../FixSpectatorCrash/FixSpectatorCrash.uc | 42 +++++++-------- sources/FixZedTimeLags/FixZedTimeLags.uc | 26 ++++----- 26 files changed, 165 insertions(+), 163 deletions(-) diff --git a/config/AcediaFixes.ini b/config/AcediaFixes.ini index 1a3415b..ec3b328 100644 --- a/config/AcediaFixes.ini +++ b/config/AcediaFixes.ini @@ -38,7 +38,7 @@ autoEnable=true ; These people are, without a question, complete degenerates. ; But making mods for only non-mentally challenged isn't inclusive. ; 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. allowSellValueIncrease=true @@ -55,10 +55,10 @@ autoEnable=true ; 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 ; 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). ; 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 ; (but not cheaper than lvl6 could). ; NOTE: this issue doesn't affect level 6 players. @@ -95,12 +95,12 @@ dualiesClasses=(single=class'KFMod.FlareRevolverPickup',dual=class'KFMod.DualFla [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. ; There's also no cooldowns on the throw, which can lead to a server crash. autoEnable=true -; Setting this flag to 'true' will allow to throw grenades by calling -; 'ServerThrow' directly, as long as player has necessary ammo. +; Setting this flag to `true` will allow to throw grenades by calling +; `ServerThrow()` directly, as long as player has necessary ammo. ; 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`. ignoreTossFlags=true @@ -108,9 +108,9 @@ ignoreTossFlags=true [AcediaFixes.FixDoshSpam] ; 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 -; '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. ; ; It fixes them by limiting speed, with which dosh can spawn, and @@ -129,8 +129,8 @@ autoEnable=true doshPerSecondLimitMax=50 doshPerSecondLimitMin=5 ; Amount of dosh pickups on the map at which we must set dosh per second -; to 'doshPerSecondLimitMin'. -; We use 'doshPerSecondLimitMax' when there's no dosh on the map and +; to `doshPerSecondLimitMin`. +; We use `doshPerSecondLimitMax` when there's no dosh on the map and ; scale linearly between them as it's amount grows. criticalDoshAmount=25 @@ -141,7 +141,7 @@ criticalDoshAmount=25 autoEnable=true ; This fix will try to kick any player that switches between active player ; 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 ; get accidentally kicked. spectatorChangeTimeout=0.25 @@ -149,14 +149,14 @@ spectatorChangeTimeout=0.25 ; Allows you to turn off server blocking. ; Players that don't respect timeout will still be kicked. ; 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 ; attempts, but can cause compatibility issues with some mutators. ; It's highly recommended to rewrite such a mutator to be compatible instead. ; NOTE: fix should be compatible with most faked players-type mutators, ; since this it remembers the difference between amount of -; real players and 'numPlayers'. -; After unblocking, it sets 'numPlayers' to +; real players and `numPlayers`. +; After unblocking, it sets `numPlayers` to ; the current amount of real players + that difference. ; So 4 players + 3 (=7 numPlayers) after kicking 1 player becomes ; 3 players + 3 (=6 numPlayers). @@ -174,8 +174,8 @@ allowServerBlock=true autoEnable=true ; Defines a general rule for chosing whether or not to apply ; friendly fire scaling. -; This can be overwritten by exceptions ('alwaysScale' or 'neverScale'). -; Enabling scaling by default without any exceptions in 'neverScale' will +; This can be overwritten by exceptions (`alwaysScale` or `neverScale`). +; Enabling scaling by default without any exceptions in `neverScale` will ; make this fix behave almost identically to Mutant's 'Explosives Fix Mutator'. scaleByDefault=false ; Damage types, for which we should always reaaply friendly fire scaling. @@ -267,9 +267,9 @@ ignoreFriendlyFire=false [AcediaFixes.FixZedTimeLags] ; When zed time activates, game speed is immediately set to -; 'zedTimeSlomoScale' (0.2 by default), defined, like all other variables, -; in 'KFGameType'. Zed time lasts 'zedTimeDuration' seconds (3.0 by default), -; but during last 'zedTimeDuration * 0.166' seconds (by default 0.498) +; `zedTimeSlomoScale` (0.2 by default), defined, like all other variables, +; in `KFGameType`. Zed time lasts `zedTimeDuration` seconds (3.0 by default), +; but during last `zedTimeDuration * 0.166` seconds (by default 0.498) ; it starts to speed back up, causing game speed to update every tick. ; This makes animations look more smooth when exiting zed-time. ; 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. ; ; 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'. -; Now zed time will behave correctly with mods that change 'zedTimeSlomoScale'. +; `zedTimeSlomoScale` was assumed to be default value of `0.2`. +; Now zed time will behave correctly with mods that change `zedTimeSlomoScale`. autoEnable=true ; Maximum amount of game speed updates upon leaving zed time. ; 2 or 3 seem to provide a good enough result that, @@ -292,10 +292,10 @@ autoEnable=true ; about 13 updates total (without this fix). maxGameSpeedUpdatesAmount=3 ; [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. -; Useful when running Acedia along with custom 'GameInfo' -; (that isn't 'KFGameType') that relies on 'Tick' event. +; Useful when running Acedia along with custom `GameInfo` +; (that isn't `KFGameType`) that relies on `Tick` event. ; 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 \ No newline at end of file diff --git a/sources/FixAmmoSelling/AmmoPickupStalker.uc b/sources/FixAmmoSelling/AmmoPickupStalker.uc index e59ad71..343bdab 100644 --- a/sources/FixAmmoSelling/AmmoPickupStalker.uc +++ b/sources/FixAmmoSelling/AmmoPickupStalker.uc @@ -24,9 +24,9 @@ class AmmoPickupStalker extends Actor; // If it is destroyed (not just picked up) - stalker must die too. var private KFAmmoPickup target; -// This variable is used to record if our 'target' ammo box was in -// active state ('Pickup') last time we've checked. -// We need this because ammo box's 'Touch' event can fire off first and +// This variable is used to record if our `target` ammo box was in +// active state (`Pickup`) last time we've checked. +// 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. // 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. diff --git a/sources/FixAmmoSelling/FixAmmoSelling.uc b/sources/FixAmmoSelling/FixAmmoSelling.uc index 5ce9bb5..c32ed41 100644 --- a/sources/FixAmmoSelling/FixAmmoSelling.uc +++ b/sources/FixAmmoSelling/FixAmmoSelling.uc @@ -8,11 +8,11 @@ * notably pipe bombs (74% discount for lvl6 demolition) * 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. * 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 - * ('default.pickupClass' is used everywhere else), + * (`default.pickupClass` is used everywhere else), * so we can easily deal with the side effects of such change. * Copyright 2020 Anton Tarasenko *------------------------------------------------------------------------------ @@ -35,23 +35,23 @@ class FixAmmoSelling extends Feature 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 - * (via 'GetAmmoCostScaling' function in a corresponding perk class). - * They are defined (along with our pickup replacements) in 'rules' array. + * (via `GetAmmoCostScaling()` function in a corresponding perk class). + * They are defined (along with our pickup replacements) in `rules` array. * That array isn't configurable, since the abusable status is hardcoded into * perk classes and the main mod that allows to change those (ServerPerks), * also solves ammo selling by a more direct method * (only available for the mods that replace player pawn class). * 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. * 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). * This means that the only two side-effects of our change are: * 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, * while trader would still display and require the original price. * 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, * 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 - * '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 - * ('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. * The only possible problem is that part of the ammo cost is * taken with a slight delay, which leaves cheaters a window of opportunity * to buy more than they can afford. * 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 * (the cost is potential bugs in this fix itself, that * 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) // players can actually buy more ammo for "fixed" weapons than they can afford // 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). // 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 // (but not cheaper than lvl6 could). // NOTE: this issue doesn't affect level 6 players. @@ -153,7 +153,7 @@ protected function OnDisabled() local int i; local AmmoPickupStalker nextStalker; local array 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) { if (registeredWeapons[i].weapon != none) @@ -242,7 +242,7 @@ private final function WeaponRecord FindAmmoInstance(WeaponRecord 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. private final function float GetPriceCorrection( KFWeapon kfWeapon, @@ -250,9 +250,9 @@ private final function float GetPriceCorrection( ) { local float boughtMagFraction; - // 'vanillaPrice' - price that would be calculated + // `vanillaPrice` - price that would be calculated // without our interference - // 'fixPrice' - price that will be calculated after + // `fixPrice` - price that will be calculated after // we've replaced pickup class local float vanillaPrice, fixPrice; local KFPlayerReplicationInfo kfRI; @@ -282,9 +282,9 @@ private final function float GetPriceCorrection( 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 -// (calculations are done via 'GetPriceCorrection'). +// (calculations are done via `GetPriceCorrection()`). private final function WeaponRecord TaxAmmoChange(WeaponRecord record) { local int ammoDiff; @@ -324,7 +324,7 @@ public final function RecordAmmoPickup(Pawn pawnWithAmmo, KFAmmoPickup pickup) { local int i; local int newAmount; - // Check conditions from 'KFAmmoPickup' code ('Touch' function) + // Check conditions from `KFAmmoPickup` code (`Touch()` method) if (pickup == none) return; if (pawnWithAmmo == none) return; if (pawnWithAmmo.controller == none) return; diff --git a/sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_CamoM32Pickup.uc b/sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_CamoM32Pickup.uc index 9c55c9e..9c7ed87 100644 --- a/sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_CamoM32Pickup.uc +++ b/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. * Copyright 2019 Anton Tarasenko *------------------------------------------------------------------------------ diff --git a/sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_CrossbowPickup.uc b/sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_CrossbowPickup.uc index 8f92c76..19350da 100644 --- a/sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_CrossbowPickup.uc +++ b/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. * Copyright 2019 Anton Tarasenko *------------------------------------------------------------------------------ diff --git a/sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_GoldenM79Pickup.uc b/sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_GoldenM79Pickup.uc index ae1e1a3..1b0eed3 100644 --- a/sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_GoldenM79Pickup.uc +++ b/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. * Copyright 2019 Anton Tarasenko *------------------------------------------------------------------------------ diff --git a/sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_LAWPickup.uc b/sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_LAWPickup.uc index d1cc802..661dc35 100644 --- a/sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_LAWPickup.uc +++ b/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. * Copyright 2019 Anton Tarasenko *------------------------------------------------------------------------------ diff --git a/sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_M32Pickup.uc b/sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_M32Pickup.uc index 04f0321..3634503 100644 --- a/sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_M32Pickup.uc +++ b/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. * Copyright 2019 Anton Tarasenko *------------------------------------------------------------------------------ diff --git a/sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_M79Pickup.uc b/sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_M79Pickup.uc index 21a93f4..9bc4d42 100644 --- a/sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_M79Pickup.uc +++ b/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. * Copyright 2019 Anton Tarasenko *------------------------------------------------------------------------------ diff --git a/sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_PipeBombPickup.uc b/sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_PipeBombPickup.uc index ff2041c..6d36cfd 100644 --- a/sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_PipeBombPickup.uc +++ b/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. * Copyright 2019 Anton Tarasenko *------------------------------------------------------------------------------ diff --git a/sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_SPGrenadePickup.uc b/sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_SPGrenadePickup.uc index 5a1a29c..0941b0a 100644 --- a/sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_SPGrenadePickup.uc +++ b/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 * and doesn't allow for a perk discount. * Copyright 2019 Anton Tarasenko diff --git a/sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_SealSquealPickup.uc b/sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_SealSquealPickup.uc index c80c56f..4647362 100644 --- a/sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_SealSquealPickup.uc +++ b/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. * Copyright 2019 Anton Tarasenko *------------------------------------------------------------------------------ diff --git a/sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_SeekerSixPickup.uc b/sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_SeekerSixPickup.uc index 31d3c26..95a40c4 100644 --- a/sources/FixAmmoSelling/FixedClasses/FixAmmoSellingClass_SeekerSixPickup.uc +++ b/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. * Copyright 2019 Anton Tarasenko *------------------------------------------------------------------------------ diff --git a/sources/FixAmmoSelling/MutatorListener_FixAmmoSelling.uc b/sources/FixAmmoSelling/MutatorListener_FixAmmoSelling.uc index 4c69dad..91d1165 100644 --- a/sources/FixAmmoSelling/MutatorListener_FixAmmoSelling.uc +++ b/sources/FixAmmoSelling/MutatorListener_FixAmmoSelling.uc @@ -47,8 +47,8 @@ private static function CheckAbusableWeapon(KFWeapon newWeapon) ammoSellingFix.FixWeapon(newWeapon); } -// This function recreates the logic of 'KFWeapon.DropFrom()', -// since standard 'ReplaceWith' function produces bad results. +// This function recreates the logic of `KFWeapon.DropFrom()`, +// since standard `ReplaceWith()` method produces bad results. private static function ReplaceOldPickup(Pickup oldPickup) { local Pawn instigator; diff --git a/sources/FixDoshSpam/FixDoshSpam.uc b/sources/FixDoshSpam/FixDoshSpam.uc index 1b33c82..ced8928 100644 --- a/sources/FixDoshSpam/FixDoshSpam.uc +++ b/sources/FixDoshSpam/FixDoshSpam.uc @@ -30,12 +30,12 @@ class FixDoshSpam extends Feature /** * First, we limit amount of dosh that can be spawned simultaneously. - * The simplest method is to place a cooldown on spawning 'CashPickup' actors, - * i.e. after spawning one 'CashPickup' we'd completely prevent spawning + * The simplest method is to place a cooldown on spawning `CashPickup` actors, + * i.e. after spawning one `CashPickup` we'd completely prevent spawning * any other instances of it for a fixed amount of time. * 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. - * 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 * that value with time, only allowing to spawn new dosh after * 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 doshPerSecondLimitMin; // Amount of dosh pickups on the map at which we must set dosh per second -// to 'doshPerSecondLimitMin'. -// We use 'doshPerSecondLimitMax' when there's no dosh on the map and +// to `doshPerSecondLimitMin`. +// We use `doshPerSecondLimitMax` when there's no dosh on the map and // scale linearly between them as it's amount grows. 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 '-1' if no connection correspond to the given controller. -// Returns '-1' if given controller is equal to 'none'. +// Returns `-1` if no connection correspond to the given controller. +// Returns `-1` if given controller is equal to `none`. private final function int GetContributorIndex(PlayerController player) { local int i; diff --git a/sources/FixDoshSpam/MutatorListener_FixDoshSpam.uc b/sources/FixDoshSpam/MutatorListener_FixDoshSpam.uc index 442a613..fae950c 100644 --- a/sources/FixDoshSpam/MutatorListener_FixDoshSpam.uc +++ b/sources/FixDoshSpam/MutatorListener_FixDoshSpam.uc @@ -26,7 +26,7 @@ static function bool CheckReplacement(Actor other, out byte isSuperRelevant) local FixDoshSpam doshFix; local PlayerController player; 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. if (other.instigator == none) return true; doshFix = FixDoshSpam(class'FixDoshSpam'.static.GetInstance()); diff --git a/sources/FixDualiesCost/FixDualiesCost.uc b/sources/FixDualiesCost/FixDualiesCost.uc index 8a20d2f..e5c9114 100644 --- a/sources/FixDualiesCost/FixDualiesCost.uc +++ b/sources/FixDualiesCost/FixDualiesCost.uc @@ -5,7 +5,7 @@ * selling pistols in a certain way. * * 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 * custom ones can do and they can handle these issues on their own * in a better way. @@ -39,23 +39,23 @@ class FixDualiesCost extends Feature * 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. * 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 * 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, * resulting in 45% of pure profit. - * 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 + * 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 * determined only at the moment of sale and depends on the perk of the seller, * allowing for possible exploits. * * 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 - * '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, - * 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 * (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 @@ -68,13 +68,13 @@ class FixDualiesCost extends Feature * 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 * 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, * but after it's sell value was already set. * 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. * 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 * 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 @@ -110,7 +110,7 @@ class FixDualiesCost extends Feature // These people are, without a question, complete degenerates. // But making mods for only non-mentally challenged isn't inclusive. // 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. var private config const bool allowSellValueIncrease; @@ -137,13 +137,13 @@ struct WeaponDataRecord var class class; var float value; // The whole point of this structure is to remember value of a weapon - // after it's destroyed. Since 'reference' will become 'none' by then, - // we will use the 'owner' reference to identify the weapon. + // after it's destroyed. Since `reference` will become `none` by then, + // we will use the `owner` reference to identify the weapon. var Pawn owner; }; var private const array storedValues; -// Sell value of the last seen pickup in 'OverridePickupQuery' +// Sell value of the last seen pickup in `OverridePickupQuery` var private int nextSellValue; protected function OnEnabled() @@ -189,8 +189,8 @@ public final function SetNextSellValue(int newValue) nextSellValue = newValue; } -// Finds a weapon of a given class in given 'Pawn' 's inventory. -// Returns 'none' if weapon isn't there. +// Finds a weapon of a given class in given `Pawn`'s inventory. +// Returns `none` if weapon isn't there. private final function KFWeapon GetWeaponOfClass( Pawn playerPawn, class weaponClass @@ -213,9 +213,9 @@ private final function KFWeapon GetWeaponOfClass( // Gets weapon index in our record of dual pistol classes. // Second variable determines whether we're searching for single // or dual variant: -// ~ 'true' - searching for single -// ~ 'false' - for dual -// Returns '-1' if weapon isn't found +// ~ `true` - searching for single +// ~ `false` - for dual +// Returns `-1` if weapon isn't found // (dual MK23 won't be found as a single weapon). private final function int GetIndexAs(KFWeapon weapon, bool asSingle) { @@ -296,9 +296,9 @@ public final function FixCostAfterThrow(KFWeapon singlePistol) dualiesClasses[index].dual); 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. - // 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. if (dualPistols.class == class'KFMod.Single') { @@ -328,8 +328,8 @@ public final function FixCostAfterBuying(KFWeapon dualPistols) dualiesClasses[index].single); if (singlePistol == none) return; - // 'singlePistol' will get destroyed, so it's sell value is irrelevant. - // 'dualPistols' will be the new pair of pistols, but it's value will + // `singlePistol` will get destroyed, so it's sell value is irrelevant. + // `dualPistols` will be the new pair of pistols, but it's value will // get overwritten by vanilla's code after this function. // So we must add it to pending values to be changed later. newPendingValue.weapon = dualPistols; @@ -343,8 +343,8 @@ public final function FixCostAfterBuying(KFWeapon dualPistols) else { // Otherwise price of a pair is the price of two pistols: - // 'singlePistol.sellValue' - the one we had - // '(FullCost / 2) * 0.75' - and the one we bought + // `singlePistol.sellValue` - the one we had + // `(FullCost / 2) * 0.75` - and the one we bought newPendingValue.value = singlePistol.sellValue + (GetFullCost(dualPistols) / 2) * 0.75; } @@ -364,12 +364,12 @@ public final function FixCostAfterPickUp(KFWeapon dualPistols) // 1. buying dualies, without having a single pistol of // corresponding type; // 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 // (in first case it never was there, in second - it got destroyed). // 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 - // 'CheckReplacement' when player picks up a weapon. + // `CheckReplacement()` when player picks up a weapon. // So we require that owner exists. if (dualPistols.owner == none) return; index = GetIndexAs(dualPistols, false); @@ -399,7 +399,7 @@ public final function ApplyPendingValues() for (i = 0; i < pendingValues.length; i += 1) { 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 // if we're allowed to increase it or it's incorrect. if (allowSellValueIncrease || pendingValues[i].weapon.sellValue == -1) { diff --git a/sources/FixFFHack/FFHackRule.uc b/sources/FixFFHack/FFHackRule.uc index 7ab58d8..090f723 100644 --- a/sources/FixFFHack/FFHackRule.uc +++ b/sources/FixFFHack/FFHackRule.uc @@ -1,6 +1,6 @@ /** * 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 *------------------------------------------------------------------------------ * This file is part of Acedia. diff --git a/sources/FixFFHack/FixFFHack.uc b/sources/FixFFHack/FixFFHack.uc index 4ff14ac..a26687b 100644 --- a/sources/FixFFHack/FixFFHack.uc +++ b/sources/FixFFHack/FixFFHack.uc @@ -35,12 +35,12 @@ class FixFFHack extends Feature * To specify required subset of weapons, one must first * chose a general rule (scale by default / don't scale by default) and then, * optionally, add exceptions to it. - * Choosing 'scaleByDefault == true' as a general rule will make this fix - * behave in the similar way to 'KFExplosiveFix' by mutant and will disable + * Choosing `scaleByDefault == true` as a general rule will make this fix + * 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 * damage classes as exceptions to fix that downside, but making an extensive * 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 * projectile weapons, used on a server. This fix comes with such filled-in * 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 // friendly fire scaling. -// This can be overwritten by exceptions ('alwaysScale' or 'neverScale'). -// Enabling scaling by default without any exceptions in 'neverScale' will -// make this fix behave almost identically to Mutant's 'Explosives Fix Mutator'. +// This can be overwritten by exceptions (`alwaysScale` or `neverScale`). +// Enabling scaling by default without any exceptions in `neverScale` will +// make this fix behave almost identically to Mutant's +// 'Explosives Fix Mutator'. var private config const bool scaleByDefault; // Damage types, for which we should always reapply friendly fire scaling. var private config const array< class > alwaysScale; diff --git a/sources/FixInfiniteNades/FixInfiniteNades.uc b/sources/FixInfiniteNades/FixInfiniteNades.uc index 429c9df..3fcbbb7 100644 --- a/sources/FixInfiniteNades/FixInfiniteNades.uc +++ b/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. * There's also no cooldowns on the throw, which can lead to a server crash. * Copyright 2019 Anton Tarasenko @@ -23,7 +23,7 @@ class FixInfiniteNades extends Feature 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 * 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 @@ -31,7 +31,7 @@ class FixInfiniteNades extends Feature * allows to spawn many grenades without any delay, * 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. * This is necessary, because whatever means we use, when we get a say in * 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. * Then, before every nade throw, it checks if player has enough ammo and * blocks grenade from spawning if he doesn't. - * We change a 'FireModeClass[0]' from 'FragFire' to 'FixedFragFire' and - * only call 'super.DoFireEffect()' if we decide spawning grenade - * should be allowed. The side effect is a change in server's 'FireModeClass'. + * We change a `FireModeClass[0]` from `FragFire` to `FixedFragFire` and + * only call `super.DoFireEffect()` if we decide spawning grenade + * 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 -// 'ServerThrow' directly, as long as player has necessary ammo. +// Setting this flag to `true` will allow to throw grenades by calling +// `ServerThrow()` directly, as long as player has necessary ammo. // 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`. 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 { var public Frag fragReference; @@ -77,8 +77,8 @@ protected function OnDisabled() } // Returns index of the connection corresponding 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 no connection correspond to the given controller. +// Returns `-1` if given controller is equal to `none`. private final function int GetAmmoIndex(Frag fragToCheck) { local int i; @@ -94,7 +94,7 @@ private final function int GetAmmoIndex(Frag fragToCheck) 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() { local int i; @@ -105,7 +105,7 @@ private final function RecreateFrags() oldRecords = ammoRecords; 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; fragOwner = oldRecords[i].fragReference.instigator; 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) { local Frag foundFrag; @@ -152,7 +152,7 @@ private final function int GetFragAmmo(Frag fragReference) 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) { 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 -// reduce current 'Frag' ammo in our records. -// Returns 'true' if we had ammo for that, and 'false' if we didn't. +// reduce current `Frag` ammo in our records. +// Returns `true` if we had ammo for that, and `false` if we didn't. public final function bool RegisterNadeThrow(Frag relevantFrag) { if (CanThrowGrenade(relevantFrag)) @@ -181,8 +181,8 @@ public final function bool RegisterNadeThrow(Frag relevantFrag) // Can we throw grenade according to our rules? // A throw can be prevented if: // - we think that player doesn't have necessary ammo; -// - Player isn't currently 'tossing' a nade, -// meaning it was a direct call of 'ServerThrow'. +// - Player isn't currently `tossing` a nade, +// meaning it was a direct call of `ServerThrow`. private final function bool CanThrowGrenade(Frag fragToCheck) { local int index; diff --git a/sources/FixInfiniteNades/FixedFragFire.uc b/sources/FixInfiniteNades/FixedFragFire.uc index e0e356c..24342cc 100644 --- a/sources/FixInfiniteNades/FixedFragFire.uc +++ b/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 - * of 'FixInfiniteNades'. + * of `FixInfiniteNades`. * Copyright 2019 Anton Tarasenko *------------------------------------------------------------------------------ * This file is part of Acedia. diff --git a/sources/FixInfiniteNades/MutatorListener_FixInfiniteNades.uc b/sources/FixInfiniteNades/MutatorListener_FixInfiniteNades.uc index 29e6e3e..0a1aec1 100644 --- a/sources/FixInfiniteNades/MutatorListener_FixInfiniteNades.uc +++ b/sources/FixInfiniteNades/MutatorListener_FixInfiniteNades.uc @@ -1,6 +1,6 @@ /** * Overloaded mutator events listener to catch - * new 'Frag' weapons and 'Nade' projectiles. + * new `Frag` weapons and `Nade` projectiles. * Copyright 2019 Anton Tarasenko *------------------------------------------------------------------------------ * This file is part of Acedia. diff --git a/sources/FixInventoryAbuse/FixInventoryAbuse.uc b/sources/FixInventoryAbuse/FixInventoryAbuse.uc index 4e83608..7414e90 100644 --- a/sources/FixInventoryAbuse/FixInventoryAbuse.uc +++ b/sources/FixInventoryAbuse/FixInventoryAbuse.uc @@ -105,8 +105,8 @@ private final function class GetRootPickupClass(KFWeapon weapon) return root; } -// Returns 'true' if passed pawn has two weapons that are just variants of -// each other (they have the same root, see 'GetRootPickupClass'). +// Returns `true` if passed pawn has two weapons that are just variants of +// each other (they have the same root, see `GetRootPickupClass()`). private final function bool HasDuplicateGuns(KFHumanPawn playerPawn) { local int i, j; @@ -150,11 +150,11 @@ private final function Vector DropWeapon(KFWeapon weaponToDrop) playerPawn = KFHumanPawn(weaponToDrop.instigator); if (playerPawn == none) return Vect(0, 0, 0); - // Calculations from 'PlayerController.ServerThrowWeapon' + // Calculations from `PlayerController.ServerThrowWeapon()` weaponVelocity = Vector(playerPawn.GetViewRotation()); weaponVelocity *= (playerPawn.velocity dot weaponVelocity) + 150; weaponVelocity += Vect(0, 0, 100); - // Calculations from 'Pawn.TossWeapon' + // Calculations from `Pawn.TossWeapon()` GetAxes(playerPawn.rotation, x, y, z); dropLocation = playerPawn.location + 0.8 * playerPawn.collisionRadius * x - 0.5 * playerPawn.collisionRadius * y; diff --git a/sources/FixPipes/FixPipes.uc b/sources/FixPipes/FixPipes.uc index 02e5fb9..cc7b68e 100644 --- a/sources/FixPipes/FixPipes.uc +++ b/sources/FixPipes/FixPipes.uc @@ -243,6 +243,7 @@ private final function InterceptProximityChecks() if (IsPipeDoingProximityChecks(pipeRecords[i].pipe)) { 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);` pipeRecords[i].timerCountDown = 1.0; pipeRecords[i].proximityCheckIntercepted = true; @@ -259,7 +260,7 @@ private final function bool IsPipeDoingProximityChecks(PipeBombProjectile pipe) if (pipe.bHidden) return false; if (pipe.bTriggered) 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 diff --git a/sources/FixSpectatorCrash/FixSpectatorCrash.uc b/sources/FixSpectatorCrash/FixSpectatorCrash.uc index d64a668..25f54fa 100644 --- a/sources/FixSpectatorCrash/FixSpectatorCrash.uc +++ b/sources/FixSpectatorCrash/FixSpectatorCrash.uc @@ -29,7 +29,7 @@ class FixSpectatorCrash extends Feature /** * We use broadcast events to track when someone is switching * 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, * before the defined cooldown ran out, - we kick him * by destroying his controller. @@ -37,7 +37,7 @@ class FixSpectatorCrash extends Feature * immediately destroyed and instead initiate player disconnection, - * exploiter might have enough time to cause a lag or even crash the server. * 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). * After all malicious players have successfully disconnected, - * 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 // 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. var private config const float spectatorChangeTimeout; @@ -53,14 +53,14 @@ var private config const float spectatorChangeTimeout; // Allows you to turn off server blocking. // Players that don't respect timeout will still be kicked. // 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, // but can cause compatibility issues with some mutators. // It's highly preferred to rewrite such a mutator to be compatible. // NOTE: it should be compatible with most faked players-type mutators, // since this fix remembers the difference between amount of -// real players and 'numPlayers'. -// After unblocking, it sets 'numPlayers' to +// real players and `numPlayers`. +// After unblocking, it sets `numPlayers` to // the current amount of real players + that difference. // So 4 players + 3 (=7 numPlayers) after kicking 1 player becomes // 3 players + 3 (=6 numPlayers). @@ -86,18 +86,18 @@ var private array violators; // Is server currently blocked? var private bool becomingActiveBlocked; // 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. -// 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. // 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. 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. -// 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) { local int i; @@ -112,8 +112,8 @@ private final function int GetCooldownIndex(PlayerController player) return -1; } -// Checks if given 'PlayerController' is registered as a violator. -// 'none' value isn't a violator. +// Checks if given `PlayerController` is registered as a violator. +// `none` value isn't a violator. public final function bool IsViolator(PlayerController player) { 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 // 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) { local int index; @@ -159,15 +159,15 @@ public final function NotifyStatusChange(PlayerController player) } } -// Pass 'true' to block server, 'false' to unblock. -// Only works if 'allowServerBlock' is set to 'true'. +// Pass `true` to block server, `false` to unblock. +// Only works if `allowServerBlock` is set to `true`. private final function SetBlock(bool activateBlock) { local KFGameType kfGameType; // Do we even need to do anything? if (!allowServerBlock) 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 (kfGameType == none) return; @@ -177,13 +177,13 @@ private final function SetBlock(bool activateBlock) { recordedNumPlayersMod = GetNumPlayersMod(); // 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. kfGameType.numPlayers = maxInt / 2; } else { - // Adding 'recordedNumPlayersMod' should prevent + // Adding `recordedNumPlayersMod` should prevent // faked players from breaking. kfGameType.numPlayers = GetRealPlayers() + recordedNumPlayersMod; } @@ -207,7 +207,7 @@ private final function TryUnblocking() // Counts current amount of "real" active players // (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() { // Auxiliary variables @@ -236,7 +236,7 @@ private final function int GetRealPlayers() } // 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 // faked players-type mutators // (difference will be equal to the amount of faked players). diff --git a/sources/FixZedTimeLags/FixZedTimeLags.uc b/sources/FixZedTimeLags/FixZedTimeLags.uc index eda98f7..f78fe83 100644 --- a/sources/FixZedTimeLags/FixZedTimeLags.uc +++ b/sources/FixZedTimeLags/FixZedTimeLags.uc @@ -2,9 +2,9 @@ * This feature fixes lags caused by a zed time that can occur * 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 - * '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'. + * change `zedTimeSlomoScale`. * Copyright 2020 Anton Tarasenko *------------------------------------------------------------------------------ * This file is part of Acedia. @@ -28,20 +28,20 @@ class FixZedTimeLags extends Feature /** * When zed time activates, game speed is immediately set to - * 'zedTimeSlomoScale' (0.2 by default), defined, like all other variables, - * in 'KFGameType'. Zed time lasts 'zedTimeDuration' seconds (3.0 by default), - * but during last 'zedTimeDuration * 0.166' seconds (by default 0.498) + * `zedTimeSlomoScale` (0.2 by default), defined, like all other variables, + * in `KFGameType`. Zed time lasts `zedTimeDuration` seconds (3.0 by default), + * but during last `zedTimeDuration * 0.166` seconds (by default 0.498) * it starts to speed back up, causing game speed to update every tick. * This makes animations look more smooth when exiting zed-time; * however, updating speed every tick for that purpose seems like * an overkill and, combined with things like * increased tick rate, certain maps and raised zed limit, * it can lead to noticeable lags at the end of zed time. - * To fix this issue we disable 'Tick' event in - * 'KFGameType' and then repeat that functionality in our own 'Tick' event, + * To fix this issue we disable `Tick()` event in + * `KFGameType` and then repeat that functionality in our own `Tick()` event, * but only perform game speed updates occasionally, * 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) * seem to suggest that there shouldn't be much visible difference if * 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. var private config const int maxGameSpeedUpdatesAmount; // [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. -// Useful when running Acedia along with custom 'GameInfo' -// (that isn't 'KFGameType') that relies on 'Tick' event. +// Useful when running Acedia along with custom `GameInfo` +// (that isn't `KFGameType`) that relies on `Tick()` event. // 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; // Counts how much time is left until next update var private float updateCooldown; @@ -145,7 +145,7 @@ private final function TellClientsZedTimeEnds() // gradual game speed increase. 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. // The rest of the updates will be uniformly distributed // over the speed up duration.