Anti item farming: item box clarity

This commit is contained in:
AJ Martinez 2023-09-12 16:26:40 -07:00
parent e71e194ddf
commit 562da2b376
2 changed files with 7 additions and 2 deletions

View file

@ -47,6 +47,11 @@ static player_t *GetItemBoxPlayer(mobj_t *mobj)
// Always use normal item box rules -- could pass in "2" for fakes but they blend in better like this
if (P_CanPickupItem(&players[i], 1))
{
// Check for players who can take this pickup, but won't be allowed to (antifarming)
UINT8 mytype = (mobj->flags2 & MF2_AMBUSH) ? 2 : 1;
if (P_IsPickupCheesy(&players[i], mytype))
continue;
fixed_t dist = P_AproxDistance(P_AproxDistance(
players[i].mo->x - mobj->x,
players[i].mo->y - mobj->y),

View file

@ -543,8 +543,8 @@ void P_CheckPointLimit(void);
boolean P_CheckRacers(void);
boolean P_CanPickupItem(player_t *player, UINT8 weapon);
boolean P_IsPickupCheesy(player_t *player, UINT8 weapon);
void P_UpdateLastPickup(player_t *player, UINT8 weapon);
boolean P_IsPickupCheesy(player_t *player, UINT8 type);
void P_UpdateLastPickup(player_t *player, UINT8 type);
boolean P_CanPickupEmblem(player_t *player, INT32 emblemID);
boolean P_EmblemWasCollected(INT32 emblemID);