diff --git a/src/p_spec.c b/src/p_spec.c index d4a2b45ce..3ea021bce 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -1420,13 +1420,15 @@ void P_RunNightsLapExecutors(mobj_t *actor) // // P_RunNightsBonusTimeExecutors // -void P_RunNightsBonusTimeExecutors(mobj_t *actor) +void P_RunNightsBonusTimeExecutors(mobj_t *actor, boolean preblowup) { size_t i; for (i = 0; i < numlines; i++) { - if (lines[i].special == 329 || lines[i].special == 330) + if ((lines[i].special == 329 || lines[i].special == 330) + && ((preblowup && (lines[i].flags & ML_BOUNCY)) + || (!preblowup && !(lines[i].flags & ML_BOUNCY)))) P_RunTriggerLinedef(&lines[i], actor, NULL); } } @@ -1574,8 +1576,8 @@ static boolean P_CheckNightsTriggerLine(line_t *triggerline, mobj_t *actor) } // Get current mare and lap (and check early return for DeNightserize) - if (perglobal || perglobalinverse - || (specialtype >= 325 && specialtype <= 326 && (fromnonights || fromnights))) + if (perglobal || perglobalinverse + || (specialtype >= 325 && specialtype <= 326 && (fromnonights || fromnights))) { UINT8 playersarenights = 0; @@ -1604,7 +1606,7 @@ static boolean P_CheckNightsTriggerLine(line_t *triggerline, mobj_t *actor) currentmare = players[i].mare; currentlap = UINT8_MAX; } - if (players[i].mare == currentmare + if (players[i].mare == currentmare && (lap > currentlap || currentlap == UINT8_MAX)) currentlap = lap; } @@ -1616,7 +1618,7 @@ static boolean P_CheckNightsTriggerLine(line_t *triggerline, mobj_t *actor) currentmare = players[i].mare; currentlap = UINT8_MAX; } - if (players[i].mare == currentmare + if (players[i].mare == currentmare && (lap < currentlap || currentlap == UINT8_MAX)) currentlap = lap; } diff --git a/src/p_spec.h b/src/p_spec.h index 5bcf25b7b..0767851e1 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -69,7 +69,7 @@ void P_ChangeSectorTag(UINT32 sector, INT16 newtag); void P_RunNightserizeExecutors(mobj_t *actor); void P_RunDeNightserizeExecutors(mobj_t *actor); void P_RunNightsLapExecutors(mobj_t *actor); -void P_RunNightsBonusTimeExecutors(mobj_t *actor); +void P_RunNightsBonusTimeExecutors(mobj_t *actor, boolean preblowup); ffloor_t *P_GetFFloorByID(sector_t *sec, UINT16 id); diff --git a/src/p_user.c b/src/p_user.c index 6b8901ac7..018387284 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6014,6 +6014,9 @@ static void P_DoNiGHTSCapsule(player_t *player) { if (player->spheres > 0) { + if (player->capsule->extravalue1 <= 0 && player->spheres >= player->capsule->health) + P_RunNightsBonusTimeExecutors(player->mo, true); + player->spheres--; player->capsule->health--; player->capsule->extravalue1++; @@ -6099,7 +6102,7 @@ static void P_DoNiGHTSCapsule(player_t *player) P_SetTarget(&players[i].capsule, NULL); // Remove capsule from everyone now that it is dead! S_StartScreamSound(player->mo, sfx_ngdone); P_SwitchSpheresBonusMode(true); - P_RunNightsBonusTimeExecutors(player->mo); + P_RunNightsBonusTimeExecutors(player->mo, false); } } else