P_IsPickupCheesy: add debugcheese cvar

This commit is contained in:
James R. 2023-09-17 18:57:10 -07:00
parent 9ba5a93407
commit a6f8f53312
2 changed files with 8 additions and 0 deletions

View file

@ -773,6 +773,7 @@ extern CV_PossibleValue_t capsuletest_cons_t[];
void CapsuleTest_OnChange(void);
consvar_t cv_capsuletest = OnlineCheat("capsuletest", "Off").values(capsuletest_cons_t).onchange(CapsuleTest_OnChange).description("Force item capsule spawning rules");
consvar_t cv_debugcheese = OnlineCheat("debugcheese", "Off").on_off().description("Disable checks that prevent farming item boxes");
consvar_t cv_debugencorevote = OnlineCheat("debugencorevote", "Off").on_off().description("Force encore choice to appear on vote screen");
void ForceSkin_OnChange(void);

View file

@ -165,6 +165,13 @@ boolean P_CanPickupItem(player_t *player, UINT8 weapon)
// 1 = floating item, 2 = perma ring, 3 = capsule
boolean P_IsPickupCheesy(player_t *player, UINT8 type)
{
extern consvar_t cv_debugcheese;
if (cv_debugcheese.value)
{
return false;
}
if (player->lastpickupdistance && player->lastpickuptype == type)
{
UINT32 distancedelta = min(player->distancetofinish - player->lastpickupdistance, player->lastpickupdistance - player->distancetofinish);