From 1e2a4c2cce3b4b8490b3cc287eeb84d2c09c02c7 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sat, 11 Jan 2020 22:26:20 -0600 Subject: [PATCH] Allow starpost Parameter to dictate order --- src/p_inter.c | 4 ++-- src/p_mobj.c | 11 ++++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index 71740822e..4aa84ba84 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1441,8 +1441,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) return; } - // We could technically have 91.1 Star Posts. 90 is cleaner. - if (special->health > 90) + // With the parameter + angle setup, we can go up to 1365 star posts. Who needs that many? + if (special->health > 1365) { CONS_Debug(DBG_GAMELOGIC, "Bad Starpost Number!\n"); return; diff --git a/src/p_mobj.c b/src/p_mobj.c index a4231fa74..93a750997 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -12911,7 +12911,16 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean thinker_t* th; mobj_t* mo2; boolean foundanother = false; - mobj->health = (mthing->angle/360) + 1; + + 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; // 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)