From df3ca712d83b0d46c08110dd89a4c631aa63ef56 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Mon, 4 May 2020 23:27:26 +0200 Subject: [PATCH] Move polyobject crush option to the first line args --- extras/conf/udb/Includes/SRB222_linedefs.cfg | 1 + src/dehacked.c | 1 - src/info.c | 33 ++------------------ src/info.h | 3 +- src/p_polyobj.c | 11 +++---- src/p_polyobj.h | 4 +-- src/p_setup.c | 10 +++++- 7 files changed, 21 insertions(+), 42 deletions(-) diff --git a/extras/conf/udb/Includes/SRB222_linedefs.cfg b/extras/conf/udb/Includes/SRB222_linedefs.cfg index d403914dd..513325225 100644 --- a/extras/conf/udb/Includes/SRB222_linedefs.cfg +++ b/extras/conf/udb/Includes/SRB222_linedefs.cfg @@ -1549,6 +1549,7 @@ udmf 4 = "Stopped by pushables"; 8 = "Don't render planes"; 16 = "Trigger linedef executor on touch"; + 32 = "Crush player"; } } arg4 diff --git a/src/dehacked.c b/src/dehacked.c index 268f9943c..98ed55732 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -8745,7 +8745,6 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_ANGLEMAN", "MT_POLYANCHOR", "MT_POLYSPAWN", - "MT_POLYSPAWNCRUSH", // Skybox objects "MT_SKYBOX", diff --git a/src/info.c b/src/info.c index bd6ccb527..fb521ec30 100644 --- a/src/info.c +++ b/src/info.c @@ -3351,7 +3351,7 @@ state_t states[NUMSTATES] = // CTF Sign {SPR_GFLG, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_NULL}, // S_GOTFLAG - + // Finish flag {SPR_FNSF, FF_TRANS30, -1, {NULL}, 0, 0, S_NULL}, // S_FINISHFLAG @@ -17999,7 +17999,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = MF_NOBLOCKMAP|MF_NOCLIP|MF_NOGRAVITY|MF_SCENERY, // flags S_NULL // raisestate }, - + { // MT_FINISHFLAG -1, // doomednum S_FINISHFLAG, // spawnstate @@ -19844,7 +19844,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = MF_SLIDEME|MF_SPECIAL|MF_NOGRAVITY|MF_NOCLIPHEIGHT, // flags S_NULL // raisestate }, - + { // MT_FLINGNIGHTSSTAR -1, // doomednum S_NIGHTSSTAR, // spawnstate @@ -20847,33 +20847,6 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_POLYSPAWNCRUSH - 762, // doomednum - S_INVISIBLE, // spawnstate - 1, // spawnhealth - S_NULL, // seestate - sfx_None, // seesound - 0, // reactiontime - sfx_None, // attacksound - S_NULL, // painstate - 3, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_NULL, // deathstate - S_NULL, // xdeathstate - sfx_None, // deathsound - 0, // speed - 1*FRACUNIT, // radius - 1*FRACUNIT, // height - 0, // display offset - 1000, // mass - 8, // damage - sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOSECTOR|MF_NOGRAVITY|MF_NOCLIP, // flags - S_NULL // raisestate - }, - { // MT_SKYBOX 780, // doomednum S_INVISIBLE, // spawnstate diff --git a/src/info.h b/src/info.h index 586209ff9..0e2125226 100644 --- a/src/info.h +++ b/src/info.h @@ -3487,7 +3487,7 @@ typedef enum state // Got Flag Sign S_GOTFLAG, - + // Finish flag S_FINISHFLAG, @@ -4754,7 +4754,6 @@ typedef enum mobj_type MT_ANGLEMAN, MT_POLYANCHOR, MT_POLYSPAWN, - MT_POLYSPAWNCRUSH, // Skybox objects MT_SKYBOX, diff --git a/src/p_polyobj.c b/src/p_polyobj.c index 2fa202a93..d745a5749 100644 --- a/src/p_polyobj.c +++ b/src/p_polyobj.c @@ -234,6 +234,10 @@ static void Polyobj_GetInfo(polyobj_t *po, line_t *line) if (line->args[3] & TMPF_EXECUTOR) // Has a linedef executor po->flags |= POF_LDEXEC; + // TODO: support customized damage somehow? + if (line->args[3] & TMPF_CRUSH) + po->damage = 3; + po->triggertag = line->args[4]; } @@ -473,10 +477,6 @@ static void Polyobj_spawnPolyObj(INT32 num, mobj_t *spawnSpot, INT32 id) po->id = id; - // TODO: support customized damage somehow? - if (spawnSpot->info->doomednum == POLYOBJ_SPAWNCRUSH_DOOMEDNUM) - po->damage = 3; - // set to default thrust; may be modified by attached thinkers // TODO: support customized thrust? po->thrust = FRACUNIT; @@ -1306,8 +1306,7 @@ void Polyobj_InitLevel(void) mo = (mobj_t *)th; - if (mo->info->doomednum == POLYOBJ_SPAWN_DOOMEDNUM || - mo->info->doomednum == POLYOBJ_SPAWNCRUSH_DOOMEDNUM) + if (mo->info->doomednum == POLYOBJ_SPAWN_DOOMEDNUM) { ++numPolyObjects; diff --git a/src/p_polyobj.h b/src/p_polyobj.h index 92dd046c5..b59e9c235 100644 --- a/src/p_polyobj.h +++ b/src/p_polyobj.h @@ -26,7 +26,6 @@ #define POLYOBJ_ANCHOR_DOOMEDNUM 760 #define POLYOBJ_SPAWN_DOOMEDNUM 761 -#define POLYOBJ_SPAWNCRUSH_DOOMEDNUM 762 // todo: REMOVE #define POLYOBJ_START_LINE 20 @@ -57,7 +56,8 @@ typedef enum TMPF_PUSHABLESTOP = 1<<2, TMPF_INVISIBLEPLANES = 1<<3, TMPF_EXECUTOR = 1<<4, - //TMPF_DONTCLIPPLANES = 1<<5, + TMPF_CRUSH = 1<<5, + //TMPF_DONTCLIPPLANES = 1<<6, } textmappolyobjectflags_t; // diff --git a/src/p_setup.c b/src/p_setup.c index acfd466d2..4ff9e6117 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -3019,9 +3019,17 @@ static void P_ConvertBinaryMap(void) case 750: case 760: case 761: - case 762: mapthings[i].tag = mapthings[i].angle; break; + case 762: + { + INT32 firstline = P_FindSpecialLineFromTag(20, mapthings[i].angle, -1); + if (firstline != -1) + lines[firstline].args[3] |= TMPF_CRUSH; + mapthings[i].tag = mapthings[i].angle; + mapthings[i].type = 761; + break; + } case 780: mapthings[i].tag = mapthings[i].extrainfo; break;