diff --git a/src/actor.h b/src/actor.h index 0c92db400..1510a5787 100644 --- a/src/actor.h +++ b/src/actor.h @@ -1169,6 +1169,7 @@ public: int Score; // manipulated by score items, ACS or DECORATE. The engine doesn't use this itself for anything. FString * Tag; // Strife's tag name. int DesignatedTeam; // Allow for friendly fire cacluations to be done on non-players. + int friendlyseeblocks; // allow to override friendly search distance calculation AActor *BlockingMobj; // Actor that blocked the last move line_t *BlockingLine; // Line that blocked the last move diff --git a/src/d_player.h b/src/d_player.h index c8c5b0fc7..80ac8c870 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -510,7 +510,7 @@ public: crouchdir = 0; crouching = 0; crouchviewdelta = 0; - viewheight = mo->ViewHeight; + viewheight = mo ? mo->ViewHeight : 0; } } diff --git a/src/g_statusbar/shared_sbar.cpp b/src/g_statusbar/shared_sbar.cpp index 30bc5f1df..22ab54035 100644 --- a/src/g_statusbar/shared_sbar.cpp +++ b/src/g_statusbar/shared_sbar.cpp @@ -2074,8 +2074,8 @@ DEFINE_ACTION_FUNCTION(DBaseStatusBar, GetGlobalACSArrayValue) enum ENumFlags { - FNF_FILLZEROS, - FNF_WHENNOTZERO, + FNF_WHENNOTZERO = 0x1, + FNF_FILLZEROS = 0x2, }; DEFINE_ACTION_FUNCTION(DBaseStatusBar, FormatNumber) diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index d44d3e444..86bd5c8c3 100644 --- a/src/p_enemy.cpp +++ b/src/p_enemy.cpp @@ -1704,7 +1704,7 @@ bool P_LookForEnemies (AActor *actor, INTBOOL allaround, FLookExParams *params) { AActor *other; - other = P_BlockmapSearch (actor, 10, LookForEnemiesInBlock, params); + other = P_BlockmapSearch (actor, actor->friendlyseeblocks, LookForEnemiesInBlock, params); if (other != NULL) { diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index fc41dd3b0..30be37f82 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -356,6 +356,7 @@ DEFINE_FIELD(AActor, BloodColor) DEFINE_FIELD(AActor, BloodTranslation) DEFINE_FIELD(AActor, RenderHidden) DEFINE_FIELD(AActor, RenderRequired) +DEFINE_FIELD(AActor, friendlyseeblocks) //========================================================================== // @@ -534,6 +535,7 @@ void AActor::Serialize(FSerializer &arc) A("stealthalpha", StealthAlpha) A("renderhidden", RenderHidden) A("renderrequired", RenderRequired); + A("friendlyseeblocks", friendlyseeblocks); } #undef A diff --git a/wadsrc/static/zscript/actor.txt b/wadsrc/static/zscript/actor.txt index 6959f6331..ebbd33808 100644 --- a/wadsrc/static/zscript/actor.txt +++ b/wadsrc/static/zscript/actor.txt @@ -203,6 +203,7 @@ class Actor : Thinker native native readonly int BloodTranslation; native int RenderHidden; native int RenderRequired; + native readonly int FriendlySeeBlocks; meta String Obituary; // Player was killed by this actor meta String HitObituary; // Player was killed by this actor in melee @@ -292,6 +293,7 @@ class Actor : Thinker native property RipLevelMax: RipLevelMax; property RenderHidden: RenderHidden; property RenderRequired: RenderRequired; + property FriendlySeeBlocks: FriendlySeeBlocks; // need some definition work first //FRenderStyle RenderStyle; @@ -372,6 +374,7 @@ class Actor : Thinker native BurnHeight -1; RenderHidden 0; RenderRequired 0; + FriendlySeeBlocks 10; // 10 (blocks) * 128 (one map unit block) } // Functions diff --git a/wadsrc/static/zscript/doom/bossbrain.txt b/wadsrc/static/zscript/doom/bossbrain.txt index fadc280e3..163683f27 100644 --- a/wadsrc/static/zscript/doom/bossbrain.txt +++ b/wadsrc/static/zscript/doom/bossbrain.txt @@ -205,7 +205,11 @@ extend class Actor if (mo.health > 0 && mo.bBossSpawned) { mo.DamageMobj(self, self, mo.health, "None", DMG_NO_ARMOR|DMG_FORCED|DMG_THRUSTLESS|DMG_NO_FACTOR); - count++; + + // [Blue Shadow] If 'mo' is a RandomSpawner or another actor which can't be killed, + // it could cause this code to loop indefinitely. So only let it trigger a loop if it + // has been actually killed. + if (mo.bKilled) count++; } } } while (count != 0); diff --git a/wadsrc/static/zscript/statusbar/statusbar.txt b/wadsrc/static/zscript/statusbar/statusbar.txt index 992328e81..56e831f97 100644 --- a/wadsrc/static/zscript/statusbar/statusbar.txt +++ b/wadsrc/static/zscript/statusbar/statusbar.txt @@ -254,8 +254,8 @@ class BaseStatusBar native ui enum ENumFlags { - FNF_FILLZEROS, - FNF_WHENNOTZERO, + FNF_WHENNOTZERO = 0x1, + FNF_FILLZEROS = 0x2, } enum EShade