Implement bludtype.txt support.

This commit is contained in:
Mari the Deer 2021-10-11 16:20:44 +02:00
commit 1add7e71b7
3 changed files with 20 additions and 3 deletions

View file

@ -568,7 +568,7 @@ extend Class SWWMHandler
}
}
// only replace vanilla blood if no other gore mod is doing it
if ( (e.Replacee == "Blood") && (!e.Replacement || e.Replacement == "Blood") && swwm_blood ) e.Replacement = "mkBlood";
if ( (((e.Replacee == "Blood") && (!e.Replacement || e.Replacement == "Blood")) || (bludtypes.Find(e.Replacee.GetClassName()) < bludtypes.Size())) && swwm_blood ) e.Replacement = "mkBlood";
else if ( e.Replacee is 'ItemFog' ) e.Replacement = 'SWWMItemFog';
else if ( e.Replacee is 'TeleportFog' ) e.Replacement = 'SWWMTeleportFog';
else if ( (e.Replacee is 'CommanderKeen') && (!e.Replacement || (e.Replacement == 'CommanderKeen')) )

View file

@ -24,6 +24,7 @@ Class SWWMHandler : EventHandler
// for checkreplacement
bool hasdrlamonsters;
int iskdizd;
Array<String> bludtypes;
// profiling data
bool profiling;
@ -52,6 +53,22 @@ Class SWWMHandler : EventHandler
}
if ( LevelInfo.MapExists("Z1M1") && (LevelInfo.MapChecksum("Z1M1") ~== "2B7744234ED2C162AD08A3255E979F65") )
iskdizd = true;
// read bludtype files if they can be found
for ( int lmp = Wads.FindLump("BLUDTYPE"); lmp != -1; lmp = Wads.FindLump("BLUDTYPE",lmp+1) )
{
String dat = Wads.ReadLump(lmp);
Array<String> list;
// fucking Windows
dat.Replace("\r","");
list.Clear();
dat.Split(list,"\n");
for ( int i=0; i<list.Size(); i++ )
{
if ( (list[i].Length() == 0) || (list[i].Left(2) == "//") || (list[i].Left(1) == "") )
continue;
bludtypes.Push(list[i]);
}
}
}
override void WorldTick()