diff --git a/src/gamedata/gi.cpp b/src/gamedata/gi.cpp index ed9b0bfa9..dd1f3bbb5 100644 --- a/src/gamedata/gi.cpp +++ b/src/gamedata/gi.cpp @@ -79,6 +79,7 @@ DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, defaultdropstyle) DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, normforwardmove) DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, normsidemove) DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, mHideParTimes) +DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, BloodSplatDecalDistance) const char *GameNames[17] = { @@ -464,6 +465,7 @@ void FMapInfoParser::ParseGameInfo() GAMEINFOKEY_TWODOUBLES(normsidemove, "normsidemove") GAMEINFOKEY_BOOL(nomergepickupmsg, "nomergepickupmsg") GAMEINFOKEY_BOOL(mHideParTimes, "hidepartimes") + GAMEINFOKEY_DOUBLE(BloodSplatDecalDistance, "bloodsplatdecaldistance") else { diff --git a/src/gamedata/gi.h b/src/gamedata/gi.h index a8d4fa66c..f36110d2f 100644 --- a/src/gamedata/gi.h +++ b/src/gamedata/gi.h @@ -217,6 +217,7 @@ struct gameinfo_t bool nomergepickupmsg; bool mHideParTimes; CutsceneDef IntroScene; + double BloodSplatDecalDistance; const char *GetFinalePage(unsigned int num) const; }; diff --git a/src/playsim/p_map.cpp b/src/playsim/p_map.cpp index 780e75e24..d397f8938 100644 --- a/src/playsim/p_map.cpp +++ b/src/playsim/p_map.cpp @@ -84,6 +84,7 @@ #include "events.h" #include "vm.h" #include "d_main.h" +#include "gi.h" #include "decallib.h" @@ -5264,7 +5265,11 @@ void P_TraceBleed(int damage, const DVector3 &pos, AActor *actor, DAngle angle, double cosp = bleedpitch.Cos(); DVector3 vdir = DVector3(cosp * bleedang.Cos(), cosp * bleedang.Sin(), -bleedpitch.Sin()); - if (Trace(pos, actor->Sector, vdir, 172, 0, ML_BLOCKEVERYTHING, actor, bleedtrace, TRACE_NoSky)) + double bleedDist = gameinfo.BloodSplatDecalDistance; + if (bleedDist <= 0.0) + bleedDist = (double)172.0; + + if (Trace(pos, actor->Sector, vdir, bleedDist, 0, ML_BLOCKEVERYTHING, actor, bleedtrace, TRACE_NoSky)) { if (bleedtrace.HitType == TRACE_HitWall) { diff --git a/wadsrc/static/mapinfo/common.txt b/wadsrc/static/mapinfo/common.txt index d61578102..3d1d41ff1 100644 --- a/wadsrc/static/mapinfo/common.txt +++ b/wadsrc/static/mapinfo/common.txt @@ -5,6 +5,7 @@ Gameinfo CheatKey = "maparrows/key.txt" EasyKey = "maparrows/ravenkey.txt" PrecacheSounds = "misc/secret", "misc/teleport", "misc/fallingsplat", "misc/ripslop" + BloodSplatDecalDistance = 172.0 } DoomEdNums diff --git a/wadsrc/static/zscript/doombase.zs b/wadsrc/static/zscript/doombase.zs index d589e1c4c..39410cbce 100644 --- a/wadsrc/static/zscript/doombase.zs +++ b/wadsrc/static/zscript/doombase.zs @@ -163,6 +163,7 @@ extend struct GameInfoStruct native double normforwardmove[2]; native double normsidemove[2]; native bool mHideParTimes; + native readonly double BloodSplatDecalDistance; } extend class Object