From e8a7f00b9b7958a4920551bd64d0f7e69b53513c Mon Sep 17 00:00:00 2001 From: Jameson Ernst Date: Sun, 7 Jan 2018 14:04:51 -0800 Subject: [PATCH 1/4] Adjust FNF enum to fix FILLZEROS --- src/g_statusbar/shared_sbar.cpp | 4 ++-- wadsrc/static/zscript/statusbar/statusbar.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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/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 From 6370594e17ddd9fa99b270a88ff67c772da3072d Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Mon, 8 Jan 2018 17:16:03 +0200 Subject: [PATCH 2/4] Fixed crash on finishgame CCMD before starting new game https://forum.zdoom.org/viewtopic.php?t=59045 --- src/d_player.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } } From f68d90accbb252306bcef62645f78afa0dfc4798 Mon Sep 17 00:00:00 2001 From: Blue Shadow Date: Mon, 8 Jan 2018 19:04:18 +0300 Subject: [PATCH 3/4] Fixed a case of infinite loop in A_BrainDie --- wadsrc/static/zscript/doom/bossbrain.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); From 7416f42b4714de223c6e8cf2f69da136f7a34aa4 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Tue, 9 Jan 2018 12:34:01 -0500 Subject: [PATCH 4/4] - add 'FriendlySeeBlocks' actor property that allows a modder to expand the maximum radius that a friendly monster can see enemies. --- src/actor.h | 1 + src/p_enemy.cpp | 2 +- src/p_mobj.cpp | 2 ++ wadsrc/static/zscript/actor.txt | 3 +++ 4 files changed, 7 insertions(+), 1 deletion(-) 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/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 d5c5e93ea..03f1e4750 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -355,6 +355,7 @@ DEFINE_FIELD(AActor, BloodColor) DEFINE_FIELD(AActor, BloodTranslation) DEFINE_FIELD(AActor, RenderHidden) DEFINE_FIELD(AActor, RenderRequired) +DEFINE_FIELD(AActor, friendlyseeblocks) //========================================================================== // @@ -533,6 +534,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 6dd222fbf..1cdbecc0e 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