Skip to content

Commit

Permalink
Attempt to fix multi key target_items tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MarioSMB committed Feb 25, 2025
1 parent 0256eb6 commit a95c44e
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions mod/quake/server/items.qc
Original file line number Diff line number Diff line change
Expand Up @@ -3194,8 +3194,20 @@ bool target_items_testinv(entity this, entity e)

if(this.items)
{
float myitems = zeroconvert(this.items);
if((myitems & e.items) != myitems)
int myitems = zeroconvert(this.items);
if((myitems & IT_KEY1) && autocvar_sv_quake_globalkeys)
{
myitems &= ~IT_KEY1;
if(keys_silver <= 0)
return false;
}
if((myitems & IT_KEY2) && autocvar_sv_quake_globalkeys)
{
myitems &= ~IT_KEY2;
if(keys_gold <= 0)
return false;
}
if(myitems && (myitems & e.items) != myitems)
return false;
}

Expand Down

0 comments on commit a95c44e

Please sign in to comment.