diff --git a/extras/conf/SRB2-22.cfg b/extras/conf/SRB2-22.cfg index 585fa7857..ea783908a 100644 --- a/extras/conf/SRB2-22.cfg +++ b/extras/conf/SRB2-22.cfg @@ -3900,6 +3900,8 @@ thingtypes { title = "Emerald Hunt Location"; sprite = "SHRDA0"; + flags8height = 24; + flags8text = "[8] Float"; } 321 { diff --git a/src/p_mobj.c b/src/p_mobj.c index 7e65c37ad..10f051891 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -11616,7 +11616,7 @@ void P_MovePlayerToStarpost(INT32 playernum) mapthing_t *huntemeralds[MAXHUNTEMERALDS]; INT32 numhuntemeralds; -static fixed_t P_GetMobjSpawnHeight(const mobjtype_t mobjtype, const fixed_t x, const fixed_t y, const fixed_t offset, const boolean flip) +fixed_t P_GetMobjSpawnHeight(mobjtype_t mobjtype, fixed_t x, fixed_t y, fixed_t offset, boolean flip) { const subsector_t *ss = R_PointInSubsector(x, y); @@ -11633,7 +11633,7 @@ static fixed_t P_GetMobjSpawnHeight(const mobjtype_t mobjtype, const fixed_t x, + offset; } -static fixed_t P_GetMapThingSpawnHeight(const mobjtype_t mobjtype, const mapthing_t* mthing, const fixed_t x, const fixed_t y) +fixed_t P_GetMapThingSpawnHeight(mobjtype_t mobjtype, mapthing_t* mthing, fixed_t x, fixed_t y) { fixed_t offset = mthing->z << FRACBITS; boolean flip = (!!(mobjinfo[mobjtype].flags & MF_SPAWNCEILING) ^ !!(mthing->options & MTF_OBJECTFLIP)); @@ -11673,6 +11673,7 @@ static fixed_t P_GetMapThingSpawnHeight(const mobjtype_t mobjtype, const mapthin // Ring-like items, may float additional units with MTF_AMBUSH. case MT_SPIKEBALL: + case MT_EMERHUNT: case MT_EMERALDSPAWN: case MT_TOKEN: case MT_EMBLEM: diff --git a/src/p_mobj.h b/src/p_mobj.h index 5deb288e4..9e7e340a6 100644 --- a/src/p_mobj.h +++ b/src/p_mobj.h @@ -451,6 +451,9 @@ void P_MovePlayerToSpawn(INT32 playernum, mapthing_t *mthing); void P_MovePlayerToStarpost(INT32 playernum); void P_AfterPlayerSpawn(INT32 playernum); +fixed_t P_GetMobjSpawnHeight(mobjtype_t mobjtype, fixed_t x, fixed_t y, fixed_t offset, boolean flip); +fixed_t P_GetMapThingSpawnHeight(mobjtype_t mobjtype, mapthing_t* mthing, fixed_t x, fixed_t y); + mobj_t *P_SpawnMapThing(mapthing_t *mthing); void P_SpawnHoop(mapthing_t *mthing); void P_SetBonusTime(mobj_t *mobj); diff --git a/src/p_setup.c b/src/p_setup.c index 700113d85..50df3c01a 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -695,6 +695,7 @@ static void P_SpawnEmeraldHunt(void) { INT32 emer1, emer2, emer3; INT32 timeout = 0; // keeps from getting stuck + fixed_t x, y, z; emer1 = emer2 = emer3 = 0; @@ -719,21 +720,30 @@ static void P_SpawnEmeraldHunt(void) //decrement spawn values to the actual number because zero is valid. if (emer1--) - P_SpawnMobj(huntemeralds[emer1]->x<y<z<x<y<x<y<z<x<y<x<y<z<x<y<