diff --git a/src/p_mobj.c b/src/p_mobj.c index afe4274b6..ec20ad0df 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6411,13 +6411,13 @@ static void P_RemoveShadow(mobj_t *thing) // SAL'S KART BATTLE MODE OVERTIME HANDLER #define MAXPLANESPERSECTOR (MAXFFLOORS+1)*2 -static void P_SpawnOvertimeParticles(fixed_t x, fixed_t y, mobjtype_t type, boolean ceiling) +static void P_SpawnOvertimeParticles(fixed_t x, fixed_t y, fixed_t scale, mobjtype_t type, boolean ceiling) { UINT8 i; fixed_t flatz[MAXPLANESPERSECTOR]; + boolean flip[MAXPLANESPERSECTOR]; UINT8 numflats = 0; mobj_t *mo; - fixed_t scale = mapobjectscale; subsector_t *ss = R_IsPointInSubsector(x, y); sector_t *sec; @@ -6425,20 +6425,11 @@ static void P_SpawnOvertimeParticles(fixed_t x, fixed_t y, mobjtype_t type, bool return; sec = ss->sector; - switch(type) - { - case MT_OVERTIMEFOG: - scale *= 4; - break; - case MT_OVERTIMEORB: - scale += battleovertime.radius/1024; - break; - default: - break; - } - // convoluted stuff JUST to get all of the planes we need to draw orbs on :V + for (i = 0; i < MAXPLANESPERSECTOR; i++) + flip[i] = false; + if (sec->floorpic != skyflatnum) { #ifdef ESLOPE @@ -6455,6 +6446,7 @@ static void P_SpawnOvertimeParticles(fixed_t x, fixed_t y, mobjtype_t type, bool #else flatz[numflats] = (sec->ceilingheight) - FixedMul(mobjinfo[type].height, scale); #endif + flip[numflats] = true; numflats++; } @@ -6481,6 +6473,7 @@ static void P_SpawnOvertimeParticles(fixed_t x, fixed_t y, mobjtype_t type, bool #else flatz[numflats] = (*rover->bottomheight) - FixedMul(mobjinfo[type].height, scale); #endif + flip[numflats] = true; numflats++; } } @@ -6494,14 +6487,37 @@ static void P_SpawnOvertimeParticles(fixed_t x, fixed_t y, mobjtype_t type, bool mo = P_SpawnMobj(x, y, flatz[i], type); // Lastly, if this can see the skybox mobj, then... we just wasted our time :V - if (skyboxmo[0] && !P_MobjWasRemoved(skyboxmo[0]) && P_CheckSight(skyboxmo[0], mo)) + if (skyboxmo[0] && !P_MobjWasRemoved(skyboxmo[0])) { - P_RemoveMobj(mo); - continue; + const fixed_t sbz = skyboxmo[0]->z; + fixed_t checkz = sec->floorheight; + + while (checkz < sec->ceilingheight) + { + P_TeleportMove(skyboxmo[0], skyboxmo[0]->x, skyboxmo[0]->y, checkz); + if (P_CheckSight(skyboxmo[0], mo)) + { + P_RemoveMobj(mo); + break; + } + else + checkz += 32*mapobjectscale; + } + + P_TeleportMove(skyboxmo[0], skyboxmo[0]->x, skyboxmo[0]->y, sbz); + + if (P_MobjWasRemoved(mo)) + continue; } P_SetScale(mo, scale); + if (flip[i]) + { + mo->flags2 |= MF2_OBJECTFLIP; + mo->eflags |= MFE_VERTICALFLIP; + } + switch(type) { case MT_OVERTIMEFOG: @@ -6525,7 +6541,6 @@ static void P_SpawnOvertimeParticles(fixed_t x, fixed_t y, mobjtype_t type, bool void P_RunBattleOvertime(void) { UINT16 i, j; - UINT16 orbs = 16; if (battleovertime.enabled < 10*TICRATE) { @@ -6563,14 +6578,21 @@ void P_RunBattleOvertime(void) } // 16 orbs at the normal minimum size of 512 - orbs = max(4, FixedDiv(battleovertime.radius, 32*mapobjectscale)>>FRACBITS); - for (i = 0; i < orbs; i++) { - angle_t ang = FixedAngle(((((i+1) * 360) / orbs) - ((leveltime/2) % 360))<subsector->sector->floorheight) + z = mobj->subsector->sector->floorheight;*/ + + if (mobj->extravalue1 < 512) + mobj->extravalue1++; + dist = mobj->extravalue1 * mapobjectscale; + P_TeleportMove(mobj, battleovertime.x + P_ReturnThrustX(NULL, ang, dist), - battleovertime.y + P_ReturnThrustY(NULL, ang, dist), battleovertime.z); + battleovertime.y + P_ReturnThrustY(NULL, ang, dist), z); + ghost = P_SpawnGhostMobj(mobj); ghost->fuse = 4; ghost->frame |= FF_FULLBRIGHT;