diff --git a/src/p_enemy.c b/src/p_enemy.c index a37da386..e4b1f302 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -8090,6 +8090,9 @@ void A_ItemPop(mobj_t *actor) { mobj_t *remains; + if (!(actor->target && actor->target->player && P_CanPickupItem(actor->target->player, false))) + return; + // de-solidify //P_UnsetThingPosition(actor); //actor->flags &= ~MF_SOLID; @@ -8123,20 +8126,7 @@ void A_ItemPop(mobj_t *actor) return; } - if (actor->target && actor->target->player // These used to be &2's and &8's for box only, but are now universal. - && !(actor->target->player->kartstuff[k_greenshell] || actor->target->player->kartstuff[k_triplegreenshell] - || actor->target->player->kartstuff[k_redshell] || actor->target->player->kartstuff[k_tripleredshell] - || actor->target->player->kartstuff[k_banana] || actor->target->player->kartstuff[k_triplebanana] - || actor->target->player->kartstuff[k_fakeitem] & 2 || actor->target->player->kartstuff[k_magnet] - || actor->target->player->kartstuff[k_bobomb] || actor->target->player->kartstuff[k_blueshell] - || actor->target->player->kartstuff[k_mushroom] || actor->target->player->kartstuff[k_fireflower] - || actor->target->player->kartstuff[k_star] || actor->target->player->kartstuff[k_goldshroom] - || actor->target->player->kartstuff[k_lightning] || actor->target->player->kartstuff[k_megashroom] - || actor->target->player->kartstuff[k_itemroulette] - || actor->target->player->kartstuff[k_boo] || actor->target->player->kartstuff[k_bootaketimer] - || actor->target->player->kartstuff[k_boostolentimer] - || actor->target->player->kartstuff[k_growshrinktimer] > 1 - || actor->target->player->kartstuff[k_goldshroomtimer])) + if (actor->target && actor->target->player) actor->target->player->kartstuff[k_itemroulette] = 1; else if (cv_debug && !(actor->target && actor->target->player)) CONS_Printf("ERROR: Powerup has no target!\n"); diff --git a/src/p_inter.c b/src/p_inter.c index 42e8976f..64c2ef94 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -150,28 +150,19 @@ boolean P_CanPickupItem(player_t *player, boolean weapon) //if (player->powers[pw_flashing] > (flashingtics/4)*3 && player->powers[pw_flashing] <= flashingtics) // return false; - if (player->kartstuff[k_bootaketimer] + if (player->kartstuff[k_greenshell] || player->kartstuff[k_triplegreenshell] + || player->kartstuff[k_redshell] || player->kartstuff[k_tripleredshell] + || player->kartstuff[k_banana] || player->kartstuff[k_triplebanana] + || player->kartstuff[k_fakeitem] & 2 || player->kartstuff[k_magnet] + || player->kartstuff[k_bobomb] || player->kartstuff[k_blueshell] + || player->kartstuff[k_mushroom] || player->kartstuff[k_fireflower] + || player->kartstuff[k_star] || player->kartstuff[k_goldshroom] + || player->kartstuff[k_lightning] || player->kartstuff[k_megashroom] + || player->kartstuff[k_itemroulette] + || player->kartstuff[k_boo] || player->kartstuff[k_bootaketimer] || player->kartstuff[k_boostolentimer] - || player->kartstuff[k_magnet] - || player->kartstuff[k_boo] - || player->kartstuff[k_mushroom] - || player->kartstuff[k_megashroom] - || player->kartstuff[k_goldshroom] - || player->kartstuff[k_star] - || player->kartstuff[k_triplebanana] == 0x8 - || player->kartstuff[k_fakeitem] == 0x2 - || player->kartstuff[k_banana] == 0x2 - || player->kartstuff[k_greenshell] == 0x2 - || player->kartstuff[k_redshell] == 0x2 - || player->kartstuff[k_laserwisp] - || player->kartstuff[k_triplegreenshell] == 0x8 - || player->kartstuff[k_bobomb] == 0x2 - || player->kartstuff[k_blueshell] - || player->kartstuff[k_jaws] == 0x4 - || player->kartstuff[k_fireflower] - || player->kartstuff[k_tripleredshell] == 0x8 - || player->kartstuff[k_lightning] - || player->kartstuff[k_kitchensink]) + || player->kartstuff[k_growshrinktimer] > 1 + || player->kartstuff[k_goldshroomtimer]) return false; return true;