From be8147406e06b6654fff1a3846589c48ac0a704f Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Mon, 1 Jan 2018 11:11:21 +0200 Subject: [PATCH 1/9] Fixed initialization of BlockThingsIterator objects https://forum.zdoom.org/viewtopic.php?t=58945 --- src/p_maputl.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/p_maputl.cpp b/src/p_maputl.cpp index 31ab08496..24c30375e 100644 --- a/src/p_maputl.cpp +++ b/src/p_maputl.cpp @@ -1275,20 +1275,21 @@ void FMultiBlockThingsIterator::Reset() // //=========================================================================== -class DBlockThingsIterator : public DObject, public FMultiBlockThingsIterator +class DBlockThingsIterator : public DObject { DECLARE_ABSTRACT_CLASS(DBlockThingsIterator, DObject); FPortalGroupArray check; + FMultiBlockThingsIterator iterator; public: FMultiBlockThingsIterator::CheckResult cres; bool Next() { - return FMultiBlockThingsIterator::Next(&cres); + return iterator.Next(&cres); } DBlockThingsIterator(AActor *origin, double checkradius = -1, bool ignorerestricted = false) - : FMultiBlockThingsIterator(check, origin, checkradius, ignorerestricted) + : iterator(check, origin, checkradius, ignorerestricted) { cres.thing = nullptr; cres.Position.Zero(); @@ -1296,7 +1297,7 @@ public: } DBlockThingsIterator(double checkx, double checky, double checkz, double checkh, double checkradius, bool ignorerestricted, sector_t *newsec) - : FMultiBlockThingsIterator(check, checkx, checky, checkz, checkh, checkradius, ignorerestricted, newsec) + : iterator(check, checkx, checky, checkz, checkh, checkradius, ignorerestricted, newsec) { cres.thing = nullptr; cres.Position.Zero(); From d8aa53f5b104602f397f86928257db75482f4307 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Mon, 1 Jan 2018 14:51:32 -0500 Subject: [PATCH 2/9] - whitelisted `openmenu` --- src/c_dispatch.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/c_dispatch.cpp b/src/c_dispatch.cpp index 2ab57ab7e..75779cc93 100644 --- a/src/c_dispatch.cpp +++ b/src/c_dispatch.cpp @@ -201,7 +201,8 @@ static const char *MenuDefCommands[] = "fpuke", "pukename", "event", - "netevent" + "netevent", + "openmenu" }; // CODE -------------------------------------------------------------------- From c4648a2b1cd9267ac02da63c91240db7c62432f5 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Tue, 2 Jan 2018 13:04:28 +0200 Subject: [PATCH 3/9] Added CheckMove() function to ZScript Actor class https://forum.zdoom.org/viewtopic.php?t=58964 --- src/p_map.cpp | 8 ++++++++ wadsrc/static/zscript/actor.txt | 1 + wadsrc/static/zscript/constants.txt | 9 +++++++++ 3 files changed, 18 insertions(+) diff --git a/src/p_map.cpp b/src/p_map.cpp index 56eea2e1f..ea4031eb4 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -2879,6 +2879,14 @@ bool P_CheckMove(AActor *thing, const DVector2 &pos, int flags) return true; } +DEFINE_ACTION_FUNCTION(AActor, CheckMove) +{ + PARAM_SELF_PROLOGUE(AActor); + PARAM_FLOAT(x); + PARAM_FLOAT(y); + PARAM_INT_DEF(flags); + ACTION_RETURN_BOOL(P_CheckMove(self, DVector2(x, y), flags)); +} //========================================================================== diff --git a/wadsrc/static/zscript/actor.txt b/wadsrc/static/zscript/actor.txt index ee464a35b..d9847e2b1 100644 --- a/wadsrc/static/zscript/actor.txt +++ b/wadsrc/static/zscript/actor.txt @@ -624,6 +624,7 @@ class Actor : Thinker native } native bool TryMove(vector2 newpos, int dropoff, bool missilecheck = false, FCheckPosition tm = null); + native bool CheckMove(vector2 newpos, int flags = 0); native void NewChaseDir(); native void RandomChaseDir(); native bool CheckMissileRange(); diff --git a/wadsrc/static/zscript/constants.txt b/wadsrc/static/zscript/constants.txt index e35af3a80..e6954b789 100644 --- a/wadsrc/static/zscript/constants.txt +++ b/wadsrc/static/zscript/constants.txt @@ -516,6 +516,15 @@ enum EWarpFlags WARPF_COPYPITCH = 0x8000, }; +// Flags for Actor.CheckMove() + +enum ECheckMoveFlags +{ + PCM_DROPOFF = 1, + PCM_NOACTORS = 1 << 1, + PCM_NOLINES = 1 << 2, +}; + // flags for A_SetPitch/SetAngle/SetRoll enum EAngleFlags { From c3c1e76e8a28f01b1d6e48daced80b546c34499e Mon Sep 17 00:00:00 2001 From: Major Cooke Date: Sun, 31 Dec 2017 19:02:14 -0600 Subject: [PATCH 4/9] Added vector diff functions to ZScript LevelLocals class MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Vec2Diff() and Vec3Diff() work like Actor’s Vec2To() and Vec3To() but use arbitrary points --- src/g_level.cpp | 46 ++++++++++++++++++++++++++++++++++ wadsrc/static/zscript/base.txt | 3 +++ 2 files changed, 49 insertions(+) diff --git a/src/g_level.cpp b/src/g_level.cpp index cb5bc4baf..ce8ff0850 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -1954,6 +1954,52 @@ DEFINE_ACTION_FUNCTION(FLevelLocals, SetInterMusic) return 0; } +//========================================================================== +// +// +//========================================================================== + +template +inline T VecDiff(const T& v1, const T& v2) +{ + T result = v2 - v1; + + if (level.subsectors.Size() > 0) + { + const sector_t *const sec1 = P_PointInSector(v1); + const sector_t *const sec2 = P_PointInSector(v2); + + if (nullptr != sec1 && nullptr != sec2) + { + result += Displacements.getOffset(sec2->PortalGroup, sec1->PortalGroup); + } + } + + return result; +} + +DEFINE_ACTION_FUNCTION(FLevelLocals, Vec2Diff) +{ + PARAM_PROLOGUE; + PARAM_FLOAT(x1); + PARAM_FLOAT(y1); + PARAM_FLOAT(x2); + PARAM_FLOAT(y2); + ACTION_RETURN_VEC2(VecDiff(DVector2(x1, y1), DVector2(x2, y2))); +} + +DEFINE_ACTION_FUNCTION(FLevelLocals, Vec3Diff) +{ + PARAM_PROLOGUE; + PARAM_FLOAT(x1); + PARAM_FLOAT(y1); + PARAM_FLOAT(z1); + PARAM_FLOAT(x2); + PARAM_FLOAT(y2); + PARAM_FLOAT(z2); + ACTION_RETURN_VEC3(VecDiff(DVector3(x1, y1, z1), DVector3(x2, y2, z2))); +} + //========================================================================== // // diff --git a/wadsrc/static/zscript/base.txt b/wadsrc/static/zscript/base.txt index 4ffe34dce..01e2af795 100644 --- a/wadsrc/static/zscript/base.txt +++ b/wadsrc/static/zscript/base.txt @@ -552,6 +552,9 @@ struct LevelLocals native native bool IsJumpingAllowed() const; native bool IsCrouchingAllowed() const; native bool IsFreelookAllowed() const; + + native static clearscope vector2 Vec2Diff(vector2 v1, vector2 v2); + native static clearscope vector3 Vec3Diff(vector3 v1, vector3 v2); String TimeFormatted(bool totals = false) { From a280cbc62cfc877f79bf547571ee51ea8cdb52ba Mon Sep 17 00:00:00 2001 From: SashaTheRed Date: Tue, 2 Jan 2018 13:56:37 +0100 Subject: [PATCH 5/9] Add sprite support for French and Portugese languages --- .../filter/game-doom/graphics/stcfn159.lmp | Bin 0 -> 126 bytes .../filter/game-doom/graphics/stcfn192.lmp | Bin 0 -> 131 bytes .../filter/game-doom/graphics/stcfn194.lmp | Bin 0 -> 147 bytes .../filter/game-doom/graphics/stcfn195.lmp | Bin 0 -> 147 bytes .../filter/game-doom/graphics/stcfn199.lmp | Bin 0 -> 145 bytes .../filter/game-doom/graphics/stcfn200.lmp | Bin 0 -> 132 bytes .../filter/game-doom/graphics/stcfn201.lmp | Bin 136 -> 132 bytes .../filter/game-doom/graphics/stcfn202.lmp | Bin 0 -> 143 bytes .../filter/game-doom/graphics/stcfn206.lmp | Bin 0 -> 122 bytes .../filter/game-doom/graphics/stcfn207.lmp | Bin 0 -> 118 bytes .../filter/game-doom/graphics/stcfn212.lmp | Bin 0 -> 144 bytes .../filter/game-doom/graphics/stcfn213.lmp | Bin 0 -> 144 bytes .../filter/game-doom/graphics/stcfn217.lmp | Bin 0 -> 129 bytes .../filter/game-doom/graphics/stcfn219.lmp | Bin 0 -> 138 bytes 14 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 wadsrc_extra/static/filter/game-doom/graphics/stcfn159.lmp create mode 100644 wadsrc_extra/static/filter/game-doom/graphics/stcfn192.lmp create mode 100644 wadsrc_extra/static/filter/game-doom/graphics/stcfn194.lmp create mode 100644 wadsrc_extra/static/filter/game-doom/graphics/stcfn195.lmp create mode 100644 wadsrc_extra/static/filter/game-doom/graphics/stcfn199.lmp create mode 100644 wadsrc_extra/static/filter/game-doom/graphics/stcfn200.lmp create mode 100644 wadsrc_extra/static/filter/game-doom/graphics/stcfn202.lmp create mode 100644 wadsrc_extra/static/filter/game-doom/graphics/stcfn206.lmp create mode 100644 wadsrc_extra/static/filter/game-doom/graphics/stcfn207.lmp create mode 100644 wadsrc_extra/static/filter/game-doom/graphics/stcfn212.lmp create mode 100644 wadsrc_extra/static/filter/game-doom/graphics/stcfn213.lmp create mode 100644 wadsrc_extra/static/filter/game-doom/graphics/stcfn217.lmp create mode 100644 wadsrc_extra/static/filter/game-doom/graphics/stcfn219.lmp diff --git a/wadsrc_extra/static/filter/game-doom/graphics/stcfn159.lmp b/wadsrc_extra/static/filter/game-doom/graphics/stcfn159.lmp new file mode 100644 index 0000000000000000000000000000000000000000..d57a2dd3eb335f4a3bfa23a61f8c8d938968c634 GIT binary patch literal 126 zcmd;J;9y{2U}Vq$k_JF*1;p+^91O(qK%4`_WkAfxtPcYJ8Cdo8x9V>Ju{iYgH|uZS j3KnK$2T>chZwE?1+1r3JU`1PDia>fd>u&=oftm&YiTEC1 literal 0 HcmV?d00001 diff --git a/wadsrc_extra/static/filter/game-doom/graphics/stcfn192.lmp b/wadsrc_extra/static/filter/game-doom/graphics/stcfn192.lmp new file mode 100644 index 0000000000000000000000000000000000000000..006a09f71c74a0a0d4a50c8fccb6864fadea3464 GIT binary patch literal 131 zcmXwx!3}^g3(FuSs5JMyOqoeqj-!9++F5m(#-~tZRJ1e-HrY&gT-4RF<5djRCbd#9HB37}9 sT^s@YkgSe1-(Zo1^@s6 literal 0 HcmV?d00001 diff --git a/wadsrc_extra/static/filter/game-doom/graphics/stcfn195.lmp b/wadsrc_extra/static/filter/game-doom/graphics/stcfn195.lmp new file mode 100644 index 0000000000000000000000000000000000000000..b9e53b30a71be447ab5eeb3c8178dc3e6bbfa17b GIT binary patch literal 147 zcmd;J;9y{2U}Vq$k`_Sh3dBJ`91p}fKwJsLZ9vSxtPcV#EMQ9iKLdxp{x*I6EnBwe kLpYoDw*vv3vq^s|P$g6uDhHuwm;ScRn>Rz1K@0|R0D)pA`v3p{ literal 0 HcmV?d00001 diff --git a/wadsrc_extra/static/filter/game-doom/graphics/stcfn199.lmp b/wadsrc_extra/static/filter/game-doom/graphics/stcfn199.lmp new file mode 100644 index 0000000000000000000000000000000000000000..07039d4fb1e0a3870b1dd7a722c785977516266b GIT binary patch literal 145 zcmXYo!3}^Q5Cl;%flmCLZyT@zE3gDRups3R q4ycp+33!vT)F>e`=WgagH43wFK!QT=Rsuv2TPbIFSnT+JME(HPxFX#E literal 136 zcmXwx%ME}q3`5K^EI9=g!Wsde*nP4AL#%9 diff --git a/wadsrc_extra/static/filter/game-doom/graphics/stcfn202.lmp b/wadsrc_extra/static/filter/game-doom/graphics/stcfn202.lmp new file mode 100644 index 0000000000000000000000000000000000000000..ca4c44ee828d8a2a3ec1c17abd015d0f7642bf42 GIT binary patch literal 143 zcmX|(!3}^w2n6vZrTE*A4cLGU*nkb#fF+5bTywg)oRSR5z=Dd3NGAjPNG39qg{)*F pJCPn=J)%IMT**llgC9ntm;ssQRU#U|=u+VhbR40pdU)jsxN>AT9!8MrM5w_z$ADfoOJp{moz@{r?Oc gAog}307`&3+w?bW-UO5ds{*P90kFU|`S#VlyCi24a68jt1fkAT9u6Mn-*o{r?Qi`ubZzG>5+aW}pBF e{AXkblG}j*#@@JT6HpSY2&fngz&b&K5OV-`5*o1p literal 0 HcmV?d00001 diff --git a/wadsrc_extra/static/filter/game-doom/graphics/stcfn212.lmp b/wadsrc_extra/static/filter/game-doom/graphics/stcfn212.lmp new file mode 100644 index 0000000000000000000000000000000000000000..ca0f6133ead1400a434583764bf350a10ae180e6 GIT binary patch literal 144 zcmY+6%ME}q3`5OFqN8y0jR9DI1z3Ou7=VpXXoa#IxGfi=JS$P`1OxyLM(HGGv4~Y{ tVi$)%$6S4z^}#?U((gP6(&!ewEN0|cT9+h~mg}=6daO3(Wv}_)=NB_6C6WLD literal 0 HcmV?d00001 diff --git a/wadsrc_extra/static/filter/game-doom/graphics/stcfn213.lmp b/wadsrc_extra/static/filter/game-doom/graphics/stcfn213.lmp new file mode 100644 index 0000000000000000000000000000000000000000..116cd8dc4b73e5f9c061045296d5b99e83a71a19 GIT binary patch literal 144 zcmd;J;9y{2U}Vq$l4d~c1jPP890SCeKwJjIO+d`RtPcV#Od#?<1G~QdHhukFJ3wp> nef`b)yEbp#1?Ozk*9Ri7%r+2f3!JlSD?}MkKTtVDKZ?l!_cbJk literal 0 HcmV?d00001 diff --git a/wadsrc_extra/static/filter/game-doom/graphics/stcfn217.lmp b/wadsrc_extra/static/filter/game-doom/graphics/stcfn217.lmp new file mode 100644 index 0000000000000000000000000000000000000000..4d8caefc761b26ab227c687475a8419177a53b79 GIT binary patch literal 129 zcmd;J;9y{2U}Vq$l7>KR3&dVP91g_EK%57}6+q0yq7MfD8Q4Me_HEns_5U+)=<9FN n-?Vk>E+_{m2$TbI7{RI_Y$i5+{VfnROsx9)+qQ!gz|8{y2 Date: Tue, 2 Jan 2018 14:09:57 +0100 Subject: [PATCH 6/9] Fixed sprite offsets --- .../filter/game-doom/graphics/stcfn200.lmp | Bin 132 -> 132 bytes .../filter/game-doom/graphics/stcfn201.lmp | Bin 132 -> 132 bytes .../filter/game-doom/graphics/stcfn206.lmp | Bin 122 -> 122 bytes .../filter/game-doom/graphics/stcfn207.lmp | Bin 118 -> 118 bytes 4 files changed, 0 insertions(+), 0 deletions(-) diff --git a/wadsrc_extra/static/filter/game-doom/graphics/stcfn200.lmp b/wadsrc_extra/static/filter/game-doom/graphics/stcfn200.lmp index d75cef410b11ec60e66742dd5f6c16f45b8c043a..c6c4637e28b05bde0a6a7c4b8f48a41dba869e07 100644 GIT binary patch delta 15 WcmZo+Y++>QVBlb2U|^icUJC#bxB@r; delta 15 UcmZo+Y++>QVBlZ?f{E<401>nTHvj+t diff --git a/wadsrc_extra/static/filter/game-doom/graphics/stcfn201.lmp b/wadsrc_extra/static/filter/game-doom/graphics/stcfn201.lmp index 06f1aec12fbe81724e81290e52a37dccc27710f5..1497e3abba8d7888b8353c3c56258183fd19deb5 100644 GIT binary patch delta 15 WcmZo+Y++>QVBlb2U|^icUJC#bxB@r; delta 15 UcmZo+Y++>QVBlZ?f{E<401>nTHvj+t diff --git a/wadsrc_extra/static/filter/game-doom/graphics/stcfn206.lmp b/wadsrc_extra/static/filter/game-doom/graphics/stcfn206.lmp index 3fe8bbb5f5b905c77427dc4c93bd613db65c6fbe..08325aecfa403d1d637b34c6a0577b386700bf7e 100644 GIT binary patch delta 11 Scmb=bV&!1qU|^WYS_%LR+yWH< delta 11 Scmb=bV&!1qU|^caS_%LR Date: Wed, 3 Jan 2018 10:48:10 +0200 Subject: [PATCH 7/9] Extended Actor.CheckMove() with optional position information https://forum.zdoom.org/viewtopic.php?t=58964 --- src/p_map.cpp | 19 ++++++++++++++++--- wadsrc/static/zscript/actor.txt | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/p_map.cpp b/src/p_map.cpp index ea4031eb4..7cab335c0 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -2784,9 +2784,8 @@ DEFINE_ACTION_FUNCTION(AActor, TryMove) // //========================================================================== -bool P_CheckMove(AActor *thing, const DVector2 &pos, int flags) +static bool P_CheckMove(AActor *thing, const DVector2 &pos, FCheckPosition& tm, int flags) { - FCheckPosition tm; double newz = thing->Z(); auto f1 = thing->flags & MF_PICKUP; @@ -2879,13 +2878,27 @@ bool P_CheckMove(AActor *thing, const DVector2 &pos, int flags) return true; } +bool P_CheckMove(AActor *thing, const DVector2 &pos, int flags) +{ + FCheckPosition tm; + return P_CheckMove(thing, pos, tm, flags); +} + DEFINE_ACTION_FUNCTION(AActor, CheckMove) { PARAM_SELF_PROLOGUE(AActor); PARAM_FLOAT(x); PARAM_FLOAT(y); PARAM_INT_DEF(flags); - ACTION_RETURN_BOOL(P_CheckMove(self, DVector2(x, y), flags)); + PARAM_POINTER_DEF(tm, FCheckPosition); + if (tm == nullptr) + { + ACTION_RETURN_BOOL(P_CheckMove(self, DVector2(x, y), flags)); + } + else + { + ACTION_RETURN_BOOL(P_CheckMove(self, DVector2(x, y), *tm, flags)); + } } diff --git a/wadsrc/static/zscript/actor.txt b/wadsrc/static/zscript/actor.txt index d9847e2b1..6dd222fbf 100644 --- a/wadsrc/static/zscript/actor.txt +++ b/wadsrc/static/zscript/actor.txt @@ -624,7 +624,7 @@ class Actor : Thinker native } native bool TryMove(vector2 newpos, int dropoff, bool missilecheck = false, FCheckPosition tm = null); - native bool CheckMove(vector2 newpos, int flags = 0); + native bool CheckMove(vector2 newpos, int flags = 0, FCheckPosition tm = null); native void NewChaseDir(); native void RandomChaseDir(); native bool CheckMissileRange(); From 6aa724a9b442e5f019fff4605498a659055ce8bc Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Wed, 3 Jan 2018 21:45:52 -0500 Subject: [PATCH 8/9] - add 'gl_riskymodernpath' for computers that worked before the GL >= 3.3 modern path enforcement, since some did, but they seemed to be the exception rather than the rule. --- src/gl/system/gl_interface.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gl/system/gl_interface.cpp b/src/gl/system/gl_interface.cpp index b2b4ea9ae..1ac8b33fe 100644 --- a/src/gl/system/gl_interface.cpp +++ b/src/gl/system/gl_interface.cpp @@ -44,6 +44,7 @@ RenderContext gl; EXTERN_CVAR(Bool, gl_legacy_mode) extern int currentrenderer; +CVAR(Bool, gl_riskymodernpath, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) //========================================================================== // @@ -209,7 +210,10 @@ void gl_LoadExtensions() // The minimum requirement for the modern render path is GL 3.3. // Although some GL 3.1 or 3.2 solutions may theoretically work they are usually too broken or too slow. // unless, of course, we're simply using this as a software backend... - if ((gl_version < 3.3f && (currentrenderer==1)) || gl_version < 3.0f) + float minmodernpath = 3.3f; + if (gl_riskymodernpath) + minmodernpath = 3.1f; + if ((gl_version < minmodernpath && (currentrenderer==1)) || gl_version < 3.0f) { gl.legacyMode = true; gl.lightmethod = LM_LEGACY; From 4b044e30d7ae9a8343eb5d42706272ba13d5ad6f Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Wed, 3 Jan 2018 23:28:48 -0500 Subject: [PATCH 9/9] - ACS stack checking (proxy commit by Rachael) --- src/p_acs.cpp | 39 ++++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 22afac1b6..e499f9d01 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -851,9 +851,25 @@ FWorldGlobalArray ACS_GlobalArrays[NUM_GLOBALVARS]; // //---------------------------------------------------------------------------- +struct FACSStackMemory +{ + int32_t& operator[](const size_t index) + { + if (index >= STACK_SIZE) + { + I_Error("Corrupted stack pointer in ACS VM"); + } + + return buffer[index]; + } + +private: + int32_t buffer[STACK_SIZE]; +}; + struct FACSStack { - int32_t buffer[STACK_SIZE]; + FACSStackMemory buffer; int sp; FACSStack *next; FACSStack *prev; @@ -1488,7 +1504,20 @@ void P_CollectACSGlobalStrings() { for (FACSStack *stack = FACSStack::head; stack != NULL; stack = stack->next) { - GlobalACSStrings.MarkStringArray(stack->buffer, stack->sp); + const int32_t sp = stack->sp; + + if (0 == sp) + { + continue; + } + else if (sp < 0 && sp >= STACK_SIZE) + { + I_Error("Corrupted stack pointer in ACS VM"); + } + else + { + GlobalACSStrings.MarkStringArray(&stack->buffer[0], sp); + } } FBehavior::StaticMarkLevelVarStrings(); P_MarkWorldVarStrings(); @@ -6889,7 +6918,7 @@ inline int getshort (int *&pc) return res; } -static bool CharArrayParms(int &capacity, int &offset, int &a, int *Stack, int &sp, bool ranged) +static bool CharArrayParms(int &capacity, int &offset, int &a, FACSStackMemory& Stack, int &sp, bool ranged) { if (ranged) { @@ -7012,7 +7041,7 @@ int DLevelScript::RunScript () } FACSStack stackobj; - int32_t *Stack = stackobj.buffer; + FACSStackMemory& Stack = stackobj.buffer; int &sp = stackobj.sp; int *pc = this->pc; @@ -7376,7 +7405,7 @@ int DLevelScript::RunScript () sp -= sizeof(CallReturn)/sizeof(int); retsp = &Stack[sp]; activeBehavior->GetFunctionProfileData(activeFunction)->AddRun(runaway - ret->EntryInstrCount); - sp = int(locals - Stack); + sp = int(locals - &Stack[0]); pc = ret->ReturnModule->Ofs2PC(ret->ReturnAddress); activeFunction = ret->ReturnFunction; activeBehavior = ret->ReturnModule;