diff --git a/extras/conf/SRB2-22.cfg b/extras/conf/SRB2-22.cfg index 585fa7857d18b7b843425121811c9ea3281779d5..ea783908a933e63319548291e57d475ff74cbfab 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 7e65c37adbae82d0c3bb7757eed077ab518054fa..10f05189189ef98a0982bb3b42c0a50ee995e232 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 5deb288e42c8969a336ab119d37f88c3fb9a9876..9e7e340a62f674e4b9c7741bd8c88bb8df212ff9 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 700113d85ff1fee46e8d07fddb121f5a5f5c2afb..50df3c01a4544111573996de4323816a7a4c99ef 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<<FRACBITS, - huntemeralds[emer1]->y<<FRACBITS, - huntemeralds[emer1]->z<<FRACBITS, MT_EMERHUNT); + { + x = huntemeralds[emer1]->x<<FRACBITS; + y = huntemeralds[emer1]->y<<FRACBITS; + z = P_GetMapThingSpawnHeight(MT_EMERHUNT, huntemeralds[emer1], x, y); + P_SpawnMobj(x, y, z, MT_EMERHUNT); + } if (emer2--) - P_SetMobjStateNF(P_SpawnMobj(huntemeralds[emer2]->x<<FRACBITS, - huntemeralds[emer2]->y<<FRACBITS, - huntemeralds[emer2]->z<<FRACBITS, MT_EMERHUNT), + { + x = huntemeralds[emer2]->x<<FRACBITS; + y = huntemeralds[emer2]->y<<FRACBITS; + z = P_GetMapThingSpawnHeight(MT_EMERHUNT, huntemeralds[emer2], x, y); + P_SetMobjStateNF(P_SpawnMobj(x, y, z, MT_EMERHUNT), mobjinfo[MT_EMERHUNT].spawnstate+1); + } if (emer3--) - P_SetMobjStateNF(P_SpawnMobj(huntemeralds[emer3]->x<<FRACBITS, - huntemeralds[emer3]->y<<FRACBITS, - huntemeralds[emer3]->z<<FRACBITS, MT_EMERHUNT), + { + x = huntemeralds[emer3]->x<<FRACBITS; + y = huntemeralds[emer3]->y<<FRACBITS; + z = P_GetMapThingSpawnHeight(MT_EMERHUNT, huntemeralds[emer3], x, y); + P_SetMobjStateNF(P_SpawnMobj(x, y, z, MT_EMERHUNT), mobjinfo[MT_EMERHUNT].spawnstate+2); + } } static void P_SpawnMapThings(boolean spawnemblems)