Allow starpost Parameter to dictate order

This commit is contained in:
fickleheart 2020-01-11 22:26:20 -06:00
parent c7ab065b0a
commit 1e2a4c2cce
2 changed files with 12 additions and 3 deletions

View File

@ -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;

View File

@ -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)