From 63fa201967144eddb44feb1c58b4ea82865e6f16 Mon Sep 17 00:00:00 2001 From: Benjamin Moir Date: Thu, 30 Jul 2015 16:56:21 +0930 Subject: [PATCH 1/9] Added Warp and its flags --- zdefs.acs | 15 +++++++++++++++ zspecial.acs | 3 +++ 2 files changed, 18 insertions(+) diff --git a/zdefs.acs b/zdefs.acs index 8016a48..2aec99e 100644 --- a/zdefs.acs +++ b/zdefs.acs @@ -1053,3 +1053,18 @@ #define QF_MAX 1 << 3 #define QF_FULLINTENSITY 1 << 4 #define QF_WAVE 1 << 5 + +#define WARPF_ABSOLUTEOFFSET 0x1 +#define WARPF_ABSOLUTEANGLE 0x2 +#define WARPF_USECALLERANGLE 0x4 +#define WARPF_NOCHECKPOSITION 0x8 +#define WARPF_INTERPOLATE 0x10 +#define WARPF_WARPINTERPOLATION 0x20 +#define WARPF_COPYINTERPOLATION 0x40 +#define WARPF_STOP 0x80 +#define WARPF_TOFLOOR 0x100 +#define WARPF_TESTONLY 0x200 +#define WARPF_ABSOLUTEPOSITION 0x400 +#define WARPF_BOB 0x800 +#define WARPF_MOVEPTR 0x1000 +#define WARPF_USEPTR 0x2000 diff --git a/zspecial.acs b/zspecial.acs index abea6e1..7d19e2a 100644 --- a/zspecial.acs +++ b/zspecial.acs @@ -364,6 +364,9 @@ special -124:EndDBTransaction(0), -125:GetDBEntries(1), + // GLOOME + -11201:Warp(6,8), + // ZDaemon's -19620:GetTeamScore(1), -19621:SetTeamScore(2), From 04bbf15b28b36e23c862c083b7d9361251df3e91 Mon Sep 17 00:00:00 2001 From: Benjamin Moir Date: Fri, 31 Jul 2015 22:26:33 +0930 Subject: [PATCH 2/9] Changed Warp to the ZDoom range --- zspecial.acs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/zspecial.acs b/zspecial.acs index 7d19e2a..be67db3 100644 --- a/zspecial.acs +++ b/zspecial.acs @@ -335,6 +335,7 @@ special -89:ChangeActorRoll(2,3), -90:GetActorRoll(1), -91:QuakeEx(8,12), + -92:Warp(6,8), // Zandronum's -100:ResetMap(0), @@ -364,9 +365,6 @@ special -124:EndDBTransaction(0), -125:GetDBEntries(1), - // GLOOME - -11201:Warp(6,8), - // ZDaemon's -19620:GetTeamScore(1), -19621:SetTeamScore(2), From 5c9dc989c5c32e52843820db8d720d070d38dcd7 Mon Sep 17 00:00:00 2001 From: Blue-Shadow Date: Fri, 28 Aug 2015 20:34:38 +0300 Subject: [PATCH 3/9] Bumped Warp's arguments number to account for 'heightoffset'. --- zspecial.acs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zspecial.acs b/zspecial.acs index be67db3..fe1b155 100644 --- a/zspecial.acs +++ b/zspecial.acs @@ -335,7 +335,7 @@ special -89:ChangeActorRoll(2,3), -90:GetActorRoll(1), -91:QuakeEx(8,12), - -92:Warp(6,8), + -92:Warp(6,9), // Zandronum's -100:ResetMap(0), From 925b279bcdc12069e22f67fdee0f586795bff214 Mon Sep 17 00:00:00 2001 From: Edoardo Prezioso Date: Sat, 5 Sep 2015 14:44:04 +0200 Subject: [PATCH 4/9] - Fixed the 'division by zero' crash in the constant expression parsing. --- error.c | 1 + error.h | 1 + parse.c | 14 ++++++++++---- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/error.c b/error.c index 16a038b..5b10345 100644 --- a/error.c +++ b/error.c @@ -104,6 +104,7 @@ static struct { ERR_MISSING_COLON, "Missing colon." }, { ERR_BAD_EXPR, "Syntax error in expression." }, { ERR_BAD_CONST_EXPR, "Syntax error in constant expression." }, + { ERR_DIV_BY_ZERO_IN_CONST_EXPR, "Division by zero in constant expression." }, { ERR_NO_DIRECT_VER, "Internal function has no direct version." }, { ERR_ILLEGAL_EXPR_IDENT, "%s : Illegal identifier in expression." }, { ERR_EXPR_FUNC_NO_RET_VAL, "Function call in expression has no return value." }, diff --git a/error.h b/error.h index fcf4b91..bdf82f1 100644 --- a/error.h +++ b/error.h @@ -69,6 +69,7 @@ typedef enum ERR_MISSING_COLON, ERR_BAD_EXPR, ERR_BAD_CONST_EXPR, + ERR_DIV_BY_ZERO_IN_CONST_EXPR, ERR_NO_DIRECT_VER, ERR_ILLEGAL_EXPR_IDENT, ERR_EXPR_FUNC_NO_RET_VAL, diff --git a/parse.c b/parse.c index 05afffc..af253b6 100644 --- a/parse.c +++ b/parse.c @@ -3807,12 +3807,18 @@ static void SendExprCommand(pcd_t pcd) PushExStk(PopExStk()*PopExStk()); break; case PCD_DIVIDE: - operand2 = PopExStk(); - PushExStk(PopExStk()/operand2); - break; case PCD_MODULUS: operand2 = PopExStk(); - PushExStk(PopExStk()%operand2); + operand1 = PopExStk(); + if (operand2 != 0) + { + PushExStk(pcd == PCD_DIVIDE ? operand1/operand2 : operand1%operand2); + } + else + { + ERR_Error(ERR_DIV_BY_ZERO_IN_CONST_EXPR, YES); + PushExStk(operand1); + } break; case PCD_EQ: PushExStk(PopExStk() == PopExStk()); From ae6b71612e06062aa14c1dcc07a64976e1f26d10 Mon Sep 17 00:00:00 2001 From: rhinoduck Date: Sat, 10 Oct 2015 17:16:32 +0200 Subject: [PATCH 5/9] Fix wrong function index on some recursive calls - problem: function index for recursive calls does not get updated in cases when the definition of the function comes before its use - solution: treat the function as predefined until we process the whole of its body so that a ref gets added if a recusive call is encountered --- parse.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/parse.c b/parse.c index af253b6..ae49ab6 100644 --- a/parse.c +++ b/parse.c @@ -825,8 +825,18 @@ static void OuterFunction(void) else { sym = SY_InsertGlobal(tk_String, SY_SCRIPTFUNC); - sym->info.scriptFunc.address = (importing == IMPORT_Importing ? 0 : pc_Address); - sym->info.scriptFunc.predefined = NO; + if (importing == IMPORT_Importing) + { + sym->info.scriptFunc.address = 0; + sym->info.scriptFunc.predefined = NO; + } + else + { + sym->info.scriptFunc.address = pc_Address; + sym->info.scriptFunc.predefined = YES; + // only for consistency with other speculated functions and pretty logs + sym->info.scriptFunc.funcNumber = 0; + } } defLine = tk_Line; From 8a91200b5504998ef27eb115fa66317eba2e26cf Mon Sep 17 00:00:00 2001 From: MajorCooke Date: Mon, 26 Oct 2015 12:19:51 -0500 Subject: [PATCH 6/9] Part 1... --- zspecial.acs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zspecial.acs b/zspecial.acs index fe1b155..627f386 100644 --- a/zspecial.acs +++ b/zspecial.acs @@ -335,7 +335,7 @@ special -89:ChangeActorRoll(2,3), -90:GetActorRoll(1), -91:QuakeEx(8,12), - -92:Warp(6,9), + -92:Warp(6,11), // Zandronum's -100:ResetMap(0), From bdfdf2c811dba29a51abee08bc98f74c1d314c2c Mon Sep 17 00:00:00 2001 From: MajorCooke Date: Mon, 26 Oct 2015 12:20:47 -0500 Subject: [PATCH 7/9] Part 2. And done. --- zdefs.acs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zdefs.acs b/zdefs.acs index 2aec99e..7c8de5a 100644 --- a/zdefs.acs +++ b/zdefs.acs @@ -1068,3 +1068,5 @@ #define WARPF_BOB 0x800 #define WARPF_MOVEPTR 0x1000 #define WARPF_USEPTR 0x2000 +#define WARPF_COPYVELOCITY = 0x4000 +#define WARPF_COPYPITCH = 0x8000 From f7bf293ce5b4ad3aaf75a2fc28af2dd6c97a5f04 Mon Sep 17 00:00:00 2001 From: MajorCooke Date: Mon, 26 Oct 2015 19:17:52 -0500 Subject: [PATCH 8/9] ... --- zdefs.acs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zdefs.acs b/zdefs.acs index 7c8de5a..bdcec78 100644 --- a/zdefs.acs +++ b/zdefs.acs @@ -1068,5 +1068,5 @@ #define WARPF_BOB 0x800 #define WARPF_MOVEPTR 0x1000 #define WARPF_USEPTR 0x2000 -#define WARPF_COPYVELOCITY = 0x4000 -#define WARPF_COPYPITCH = 0x8000 +#define WARPF_COPYVELOCITY 0x4000 +#define WARPF_COPYPITCH 0x8000 From b90863890f04db6099a3424d89479c847a2ffacb Mon Sep 17 00:00:00 2001 From: John Palomo Jr Date: Sat, 21 Nov 2015 05:59:17 -0500 Subject: [PATCH 9/9] Added PICKAF_FORCETID and PICKAF_RETURNTID flags to PickActor. --- zdefs.acs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zdefs.acs b/zdefs.acs index bdcec78..9533b0a 100644 --- a/zdefs.acs +++ b/zdefs.acs @@ -984,6 +984,11 @@ #define FHF_NORANDOMPUFFZ 1 #define FHF_NOIMPACTDECAL 2 +// PickActor flags + +#define PICKAF_FORCETID 1 +#define PICKAF_RETURNTID 2 + // Actor flags #define MF_SPECIAL 0x00000001 #define MF_SOLID 0x00000002