diff --git a/src/p_spec.c b/src/p_spec.c index 3ea021bce..617625fc1 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -1418,17 +1418,20 @@ void P_RunNightsLapExecutors(mobj_t *actor) } // -// P_RunNightsBonusTimeExecutors +// P_RunNightsCapsuleTouchExecutors // -void P_RunNightsBonusTimeExecutors(mobj_t *actor, boolean preblowup) +void P_RunNightsCapsuleTouchExecutors(mobj_t *actor, boolean entering, boolean enoughspheres) { size_t i; for (i = 0; i < numlines; i++) { if ((lines[i].special == 329 || lines[i].special == 330) - && ((preblowup && (lines[i].flags & ML_BOUNCY)) - || (!preblowup && !(lines[i].flags & ML_BOUNCY)))) + && ((entering && (lines[i].flags & ML_TFERLINE)) + || (!entering && !(lines[i].flags & ML_TFERLINE))) + && ((lines[i].flags & ML_DONTPEGTOP) + || (enoughspheres && !(lines[i].flags & ML_BOUNCY)) + || (!enoughspheres && (lines[i].flags & ML_BOUNCY)))) P_RunTriggerLinedef(&lines[i], actor, NULL); } } diff --git a/src/p_spec.h b/src/p_spec.h index 0767851e1..e0bcc18eb 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, boolean preblowup); +void P_RunNightsCapsuleTouchExecutors(mobj_t *actor, boolean entering, boolean enoughspheres); ffloor_t *P_GetFFloorByID(sector_t *sec, UINT16 id); diff --git a/src/p_user.c b/src/p_user.c index e3b6f2261..7e678fb61 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6009,8 +6009,8 @@ static void P_DoNiGHTSCapsule(player_t *player) } } - if (player->capsule->extravalue2 <= 0 && player->spheres >= player->capsule->health) - P_RunNightsBonusTimeExecutors(player->mo, true); // run pre-blowup executors + if (player->capsule->extravalue2 <= 0) + P_RunNightsCapsuleTouchExecutors(player->mo, true, player->spheres >= player->capsule->health); // run capsule entrance executors // Time to blow it up! if (player->mo->x == player->capsule->x @@ -6104,7 +6104,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, false); // run post blow-up executors + P_RunNightsCapsuleTouchExecutors(player->mo, false, true); // run capsule exit executors, and we destroyed it } } else @@ -6114,6 +6114,7 @@ static void P_DoNiGHTSCapsule(player_t *player) player->textvar = 3; // Get more rings! player->capsule->reactiontime = 0; player->capsule->extravalue1 = player->capsule->extravalue2 = -1; + P_RunNightsCapsuleTouchExecutors(player->mo, false, false); // run capsule exit executors, and we lacked rings } } else