fix exp gain for custom zeds

This commit is contained in:
GenZmeY 2022-05-18 08:56:26 +03:00
parent 46c85f41a3
commit 5dffb9edea
2 changed files with 23 additions and 1 deletions

View File

@ -0,0 +1,17 @@
class KFGI_Access extends Object
within KFGameInfo;
// Bypass protected modifier for these lists
function bool IsCustomZed(class<KFPawn_Monster> KFPM)
{
if (AIClassList.Find(KFPM) != INDEX_NONE) return false;
if (NonSpawnAIClassList.Find(KFPM) != INDEX_NONE) return false;
if (AIBossClassList.Find(KFPM) != INDEX_NONE) return false;
return true;
}
defaultproperties
{
}

View File

@ -63,6 +63,8 @@ var config bool bDontUseOriginalWeaponry;
var config bool bAllowStandartPistolUpgrade;
var config bool bDisableCustomTrader;
var KFGI_Access KFGIA;
//Custom XP lightly array
struct CustomZedXPStruct
{
@ -102,6 +104,7 @@ function PostBeginPlay()
class'OnlineSubsystem'.Static.StringToUniqueNetId(DevList[i],Id);
DevNetID[i] = Id;
}
ServerStatLoader = new (None) class'ExtPlayerStat';
WorldInfo.Game.HUDType = class'KFExtendedHUD';
WorldInfo.Game.PlayerControllerClass = class'ExtPlayerController';
@ -110,6 +113,8 @@ function PostBeginPlay()
KFGameInfo(WorldInfo.Game).CustomizationPawnClass = class'ExtPawn_Customization';
KFGameInfo(WorldInfo.Game).KFGFxManagerClass = class'ExtMoviePlayer_Manager';
KFGIA = new(KFGameInfo(WorldInfo.Game)) class'KFGI_Access';
// trader things
if (!bDisableCustomTrader && CustomTrader==None)
{
@ -553,7 +558,7 @@ function CustomXP(Controller Killer, Controller Killed)
break;
}
}
if (cont && !IsFromMod(KFM))
if (cont && !KFGIA.IsCustomZed(KFM.class))
{
// No mods - exit the loop, the game will add experience by itself
continue;