Adapt star posts to UDMF

This commit is contained in:
MascaraSnake 2021-12-21 18:27:19 +01:00
parent af30847a1f
commit 693fa7ba81
3 changed files with 16 additions and 9 deletions

View file

@ -4370,6 +4370,10 @@ udmf
sprite = "STPTA0M0";
width = 64;
height = 128;
arg0
{
title = "Order";
}
}
520
{

View file

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

View file

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