From 693fa7ba81ee97dc3207e90c03ecbbd0d431157b Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Tue, 21 Dec 2021 18:27:19 +0100 Subject: [PATCH] Adapt star posts to UDMF --- extras/conf/udb/Includes/SRB222_things.cfg | 4 ++++ src/p_mobj.c | 10 +--------- src/p_setup.c | 11 +++++++++++ 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/extras/conf/udb/Includes/SRB222_things.cfg b/extras/conf/udb/Includes/SRB222_things.cfg index 03c2fc82d..0fe11cf5e 100644 --- a/extras/conf/udb/Includes/SRB222_things.cfg +++ b/extras/conf/udb/Includes/SRB222_things.cfg @@ -4370,6 +4370,10 @@ udmf sprite = "STPTA0M0"; width = 64; height = 128; + arg0 + { + title = "Order"; + } } 520 { diff --git a/src/p_mobj.c b/src/p_mobj.c index 7f12a190b..f6954baef 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -12966,15 +12966,7 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean mobj_t* mo2; boolean foundanother = false; - if (mthing->extrainfo) - // Allow thing Parameter to define star post num too! - // For starposts above param 15 (the 16th), add 360 to the angle like before and start parameter from 1 (NOT 0)! - // So the 16th starpost is angle=0 param=15, the 17th would be angle=360 param=1. - // This seems more intuitive for mappers to use until UDMF is ready, since most SP maps won't have over 16 consecutive star posts. - mobj->health = mthing->extrainfo + (mthing->angle/360)*15 + 1; - else - // Old behavior if Parameter is 0; add 360 to the angle for each consecutive star post. - mobj->health = (mthing->angle/360) + 1; + mobj->health = mthing->args[0] + 1; // See if other starposts exist in this level that have the same value. for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) diff --git a/src/p_setup.c b/src/p_setup.c index bf12c88bc..1761a4be9 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -4890,6 +4890,17 @@ static void P_ConvertBinaryMap(void) case 111: //Pop-up Turret mapthings[i].args[0] = mapthings[i].angle; break; + case 502: //Star post + if (mapthings[i].extrainfo) + // Allow thing Parameter to define star post num too! + // For starposts above param 15 (the 16th), add 360 to the angle like before and start parameter from 1 (NOT 0)! + // So the 16th starpost is angle=0 param=15, the 17th would be angle=360 param=1. + // This seems more intuitive for mappers to use, since most SP maps won't have over 16 consecutive star posts. + mapthings[i].args[0] = mapthings[i].extrainfo + (mapthings[i].angle/360) * 15; + else + // Old behavior if Parameter is 0; add 360 to the angle for each consecutive star post. + mapthings[i].args[0] = (mapthings[i].angle/360); + break; case 753: //Zoom tube waypoint mapthings[i].args[0] = mapthings[i].angle >> 8; mapthings[i].args[1] = mapthings[i].angle & 255;