mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-28 23:11:58 +00:00
- Fixed: InInventory didn't work quite right with multiple items.
This commit is contained in:
parent
5e34b78451
commit
0223b7f460
1 changed files with 8 additions and 35 deletions
|
@ -3383,43 +3383,16 @@ class CommandInInventory : public SBarInfoCommandFlowControl
|
||||||
AInventory *invItem[2] = { statusBar->CPlayer->mo->FindInventory(item[0]), statusBar->CPlayer->mo->FindInventory(item[1]) };
|
AInventory *invItem[2] = { statusBar->CPlayer->mo->FindInventory(item[0]), statusBar->CPlayer->mo->FindInventory(item[1]) };
|
||||||
if (invItem[0] != NULL && amount[0] > 0 && invItem[0]->Amount < amount[0]) invItem[0] = NULL;
|
if (invItem[0] != NULL && amount[0] > 0 && invItem[0]->Amount < amount[0]) invItem[0] = NULL;
|
||||||
if (invItem[1] != NULL && amount[1] > 0 && invItem[1]->Amount < amount[1]) invItem[1] = NULL;
|
if (invItem[1] != NULL && amount[1] > 0 && invItem[1]->Amount < amount[1]) invItem[1] = NULL;
|
||||||
if(invItem[1] != NULL && conditionAnd)
|
|
||||||
|
if (item[1])
|
||||||
{
|
{
|
||||||
if((invItem[0] != NULL && invItem[1] != NULL) && !negate)
|
if (conditionAnd)
|
||||||
{
|
SetTruth((invItem[0] && invItem[1]) != negate, block, statusBar);
|
||||||
SetTruth(true, block, statusBar);
|
else
|
||||||
return;
|
SetTruth((invItem[0] || invItem[1]) != negate, block, statusBar);
|
||||||
}
|
|
||||||
else if((invItem[0] == NULL || invItem[1] == NULL) && negate)
|
|
||||||
{
|
|
||||||
SetTruth(true, block, statusBar);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if(invItem[1] != NULL && !conditionAnd)
|
else
|
||||||
{
|
SetTruth((invItem[0] != NULL) != negate, block, statusBar);
|
||||||
if((invItem[0] != NULL || invItem[1] != NULL) && !negate)
|
|
||||||
{
|
|
||||||
SetTruth(true, block, statusBar);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else if((invItem[0] == NULL && invItem[1] == NULL) && negate)
|
|
||||||
{
|
|
||||||
SetTruth(true, block, statusBar);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if((invItem[0] != NULL) && !negate)
|
|
||||||
{
|
|
||||||
SetTruth(true, block, statusBar);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else if((invItem[0] == NULL) && negate)
|
|
||||||
{
|
|
||||||
SetTruth(true, block, statusBar);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
SetTruth(false, block, statusBar);
|
|
||||||
}
|
}
|
||||||
protected:
|
protected:
|
||||||
bool conditionAnd;
|
bool conditionAnd;
|
||||||
|
|
Loading…
Reference in a new issue