diff --git a/src/k_collide.c b/src/k_collide.c index 33834e88f..ee773dfa3 100644 --- a/src/k_collide.c +++ b/src/k_collide.c @@ -474,10 +474,10 @@ boolean K_DropTargetCollide(mobj_t *t1, mobj_t *t2) { mobj_t *draggeddroptarget = (t1->type == MT_DROPTARGET_SHIELD) ? t1->target : NULL; - if ((t1->threshold > 0 && (t2->hitlag > 0 || !draggeddroptarget)) || (t2->threshold > 0 && t1->hitlag > 0)) + if ((t1->threshold > 0 && t2->hitlag > 0) || (t2->threshold > 0 && t1->hitlag > 0)) return true; - if (((t1->target == t2) || (t1->target == t2->target)) && (t1->threshold > 0 || (t2->type != MT_PLAYER && t2->threshold > 0))) + if (((t1->target == t2) || (t1->target == t2->target)) && ((t1->threshold > 0 && t2->type == MT_PLAYER) || (t2->type != MT_PLAYER && t2->threshold > 0))) return true; if (t1->health <= 0 || t2->health <= 0) @@ -711,7 +711,7 @@ boolean K_BubbleShieldCollide(mobj_t *t1, mobj_t *t2) } else { - if (!t2->threshold) + if (!t2->threshold || t2->type == MT_DROPTARGET) { if (!t2->momx && !t2->momy) { diff --git a/src/k_kart.c b/src/k_kart.c index 813c0f441..4284c286d 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -5625,7 +5625,7 @@ void K_PuntMine(mobj_t *origMine, mobj_t *punter) spd = FixedMul(82 * punter->scale, K_GetKartGameSpeedScalar(gamespeed)); // Avg Speed is 41 in Normal - mine->flags |= MF_NOCLIPTHING; + mine->flags |= (MF_NOCLIP|MF_NOCLIPTHING); P_SetMobjState(mine, S_SSMINE_AIR1); mine->threshold = 10; @@ -5637,7 +5637,7 @@ void K_PuntMine(mobj_t *origMine, mobj_t *punter) //K_SetHitLagForObjects(punter, mine, 5); - mine->flags &= ~MF_NOCLIPTHING; + mine->flags &= ~(MF_NOCLIP|MF_NOCLIPTHING); } #define THUNDERRADIUS 320 @@ -5930,9 +5930,7 @@ void K_DoInvincibility(player_t *player, tic_t time) P_SetScale(overlay, player->mo->scale); } - player->invincibilitytimer += time; - - if (P_IsLocalPlayer(player) == true) + if (P_IsLocalPlayer(player) == true && player->invincibilitytimer == 0) { S_ChangeMusicSpecial("kinvnc"); } @@ -5941,6 +5939,8 @@ void K_DoInvincibility(player_t *player, tic_t time) S_StartSound(player->mo, sfx_alarmi); } + player->invincibilitytimer += time; + P_RestoreMusic(player); } @@ -6150,11 +6150,11 @@ void K_DropHnextList(player_t *player, boolean keepshields) { fixed_t radius = FixedMul(work->info->radius, dropwork->destscale); radius = FixedHypot(player->mo->radius, player->mo->radius) + FixedHypot(radius, radius); // mobj's distance from its Target, or Radius. - dropwork->flags |= MF_NOCLIPTHING; + dropwork->flags |= (MF_NOCLIP|MF_NOCLIPTHING); work->momx = FixedMul(FINECOSINE(work->angle>>ANGLETOFINESHIFT), radius); work->momy = FixedMul(FINESINE(work->angle>>ANGLETOFINESHIFT), radius); P_MoveOrigin(dropwork, player->mo->x + work->momx, player->mo->y + work->momy, player->mo->z); - dropwork->flags &= ~MF_NOCLIPTHING; + dropwork->flags &= ~(MF_NOCLIP|MF_NOCLIPTHING); } dropwork->flags2 |= MF2_AMBUSH; @@ -10540,11 +10540,11 @@ void K_MoveKartPlayer(player_t *player, boolean onground) S_StartSound(player->mo, sfx_alarmg); } - P_RestoreMusic(player); - player->growshrinktimer = max(0, player->growshrinktimer); player->growshrinktimer += ((gametyperules & GTR_CLOSERPLAYERS) ? 8 : 12) * TICRATE; + P_RestoreMusic(player); + S_StartSound(player->mo, sfx_kc5a); player->itemamount--; diff --git a/src/objects/orbinaut.c b/src/objects/orbinaut.c index 27e3fe742..6f9ba3788 100644 --- a/src/objects/orbinaut.c +++ b/src/objects/orbinaut.c @@ -335,23 +335,24 @@ void Obj_OrbinautJawzMoveHeld(player_t *player) { fixed_t finalscale = K_ItemScaleForPlayer(player); fixed_t speed = 0; - mobj_t *cur = NULL; + mobj_t *cur = NULL, *next = player->mo->hnext; player->bananadrag = 0; // Just to make sure - cur = player->mo->hnext; - speed = ((8 - min(4, player->itemamount)) * cur->info->speed) / 7; + if (next == NULL) + return; - while (cur != NULL && P_MobjWasRemoved(cur) == false) + speed = ((8 - min(4, player->itemamount)) * next->info->speed) / 7; + + while ((cur = next) != NULL && P_MobjWasRemoved(cur) == false) { const fixed_t radius = FixedHypot(player->mo->radius, player->mo->radius) + FixedHypot(cur->radius, cur->radius); // mobj's distance from its Target, or Radius. fixed_t z; + next = cur->hnext; + if (!cur->health) - { - cur = cur->hnext; continue; - } cur->color = player->skincolor; @@ -391,15 +392,17 @@ void Obj_OrbinautJawzMoveHeld(player_t *player) z = player->mo->z + player->mo->height - cur->height; } - cur->flags |= MF_NOCLIPTHING; // temporarily make them noclip other objects so they can't hit anyone while in the player + cur->flags |= (MF_NOCLIP|MF_NOCLIPTHING); // temporarily make them noclip other objects so they can't hit anyone while in the player P_MoveOrigin(cur, player->mo->x, player->mo->y, z); cur->momx = FixedMul(FINECOSINE(cur->angle >> ANGLETOFINESHIFT), orbinaut_shield_dist(cur)); cur->momy = FixedMul(FINESINE(cur->angle >> ANGLETOFINESHIFT), orbinaut_shield_dist(cur)); - cur->flags &= ~MF_NOCLIPTHING; + cur->flags &= ~(MF_NOCLIP|MF_NOCLIPTHING); if (!P_TryMove(cur, player->mo->x + cur->momx, player->mo->y + cur->momy, true, NULL)) { P_SlideMove(cur, NULL); + if (P_MobjWasRemoved(cur)) + continue; } if (P_IsObjectOnGround(player->mo)) @@ -426,8 +429,6 @@ void Obj_OrbinautJawzMoveHeld(player_t *player) cur->z = z; cur->momx = cur->momy = 0; cur->angle += ANGLE_90; - - cur = cur->hnext; } } diff --git a/src/p_map.c b/src/p_map.c index 8c5751d2a..a02a5191d 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -917,6 +917,7 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing) || tm.thing->type == MT_BANANA || tm.thing->type == MT_EGGMANITEM || tm.thing->type == MT_BALLHOG || tm.thing->type == MT_SSMINE || tm.thing->type == MT_LANDMINE || tm.thing->type == MT_SINK || tm.thing->type == MT_GARDENTOP + || tm.thing->type == MT_DROPTARGET || (tm.thing->type == MT_PLAYER && thing->target != tm.thing))) { // see if it went over / under @@ -931,8 +932,9 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing) || (tm.thing->player && tm.thing->player->bubbleblowup)) && (thing->type == MT_ORBINAUT || thing->type == MT_JAWZ || thing->type == MT_GACHABOM || thing->type == MT_BANANA || thing->type == MT_EGGMANITEM || thing->type == MT_BALLHOG - || thing->type == MT_SSMINE || tm.thing->type == MT_LANDMINE || thing->type == MT_SINK + || thing->type == MT_SSMINE || thing->type == MT_LANDMINE || thing->type == MT_SINK || thing->type == MT_GARDENTOP + || thing->type == MT_DROPTARGET || (thing->type == MT_PLAYER && tm.thing->target != thing))) { // see if it went over / under @@ -967,7 +969,7 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing) else if ((tm.thing->type == MT_DROPTARGET || tm.thing->type == MT_DROPTARGET_SHIELD) && (thing->type == MT_ORBINAUT || thing->type == MT_JAWZ || thing->type == MT_GACHABOM || thing->type == MT_BANANA || thing->type == MT_EGGMANITEM || thing->type == MT_BALLHOG - || thing->type == MT_SSMINE || tm.thing->type == MT_LANDMINE || thing->type == MT_SINK + || thing->type == MT_SSMINE || thing->type == MT_LANDMINE || thing->type == MT_SINK || thing->type == MT_GARDENTOP || (thing->type == MT_PLAYER))) { diff --git a/src/p_mobj.c b/src/p_mobj.c index 232812765..3f0481a94 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1791,6 +1791,8 @@ void P_XYMovement(mobj_t *mo) { S_StartSound(mo, mo->info->attacksound); mo->health--; + // This prevents an item thrown at a wall from + // phasing through you on its return. mo->threshold = 0; } /*FALLTHRU*/ @@ -1811,6 +1813,12 @@ void P_XYMovement(mobj_t *mo) S_StartSound(mo, sfx_s3k44); // Bubble bounce break; + case MT_DROPTARGET: + // This prevents an item thrown at a wall from + // phasing through you on its return. + mo->threshold = 0; + break; + default: break; }