From 60ba914cef8ce092c5ecc97c91189d4395e0acd7 Mon Sep 17 00:00:00 2001 From: inklesspen_rus Date: Sat, 9 Jan 2021 13:26:05 +0300 Subject: [PATCH] Fixed #22 and CustomXP optimization (?) --- ServerExt/Classes/ExtPerkManager.uc | 1 + ServerExt/Classes/Ext_PerkBase.uc | 4 ++-- ServerExtMut/Classes/ServerExtMut.uc | 13 ++++--------- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/ServerExt/Classes/ExtPerkManager.uc b/ServerExt/Classes/ExtPerkManager.uc index 4bb1449..2969113 100644 --- a/ServerExt/Classes/ExtPerkManager.uc +++ b/ServerExt/Classes/ExtPerkManager.uc @@ -146,6 +146,7 @@ function ApplyPerk(Ext_PerkBase P) ModifyHealth(HP.HealthMax); ModifyArmor(HP.MaxArmor); + CurrentPerk.UpdateAmmoStatus(HP.InvManager); if (HP.Health > HP.HealthMax) HP.Health = HP.HealthMax; if (HP.Armor > HP.MaxArmor) HP.Armor = HP.MaxArmor; diff --git a/ServerExt/Classes/Ext_PerkBase.uc b/ServerExt/Classes/Ext_PerkBase.uc index ddbb798..6d57cfa 100644 --- a/ServerExt/Classes/Ext_PerkBase.uc +++ b/ServerExt/Classes/Ext_PerkBase.uc @@ -1372,8 +1372,8 @@ final function UpdateAmmoStatus(InventoryManager Inv) foreach Inv.InventoryActors(class'KFWeapon',W) { - if (IsWeaponOnPerk(W)) - W.ReInitializeAmmoCounts(PerkManager); + // if (IsWeaponOnPerk(W)) + W.ReInitializeAmmoCounts(PerkManager); } } diff --git a/ServerExtMut/Classes/ServerExtMut.uc b/ServerExtMut/Classes/ServerExtMut.uc index 7757919..51db0b1 100644 --- a/ServerExtMut/Classes/ServerExtMut.uc +++ b/ServerExtMut/Classes/ServerExtMut.uc @@ -606,17 +606,12 @@ function CustomXP(Controller Killer, Controller Killed) KFPC = KFPlayerController(DamagerKFPRI.Owner); if (KFPC != none) { - XP = 0; - for (j = 0; j < CustomZedXPArray.Length; j++) + j = CustomZedXPArray.Find('zedclass', KFM.Class); + if(j != -1) { - if (KFM.Class == CustomZedXPArray[j].zedclass) - { - XP = CustomZedXPArray[j].XPValues[MyKFGI.GameDifficulty]; - break; - } + XP = CustomZedXPArray[j].XPValues[MyKFGI.GameDifficulty]; } - - if (XP == 0) + else { XP = KFM.static.GetXPValue(MyKFGI.GameDifficulty); }