Code: Select all
A_JumpIfInventory("inventoryitem",0,offset/"state",pointer)
Moderator: GZDoom Developers
Code: Select all
A_JumpIfInventory("inventoryitem",0,offset/"state",pointer)
Code: Select all
Ready:
SPRT 1 AB
{
A_WeaponReady;
If(A_JumpIfInventory("inventoryitem",0,"state")){Return state("state");}
Else{Return state("");}
}
Loop
The Problem is that doing that with countinv is clunky when it comes to situations that would effect the capacity of the effected item unless you use a separate case to check for such things.Void Weaver wrote:Actually you can correctly perform A_JumpIfInventory inside of anon function:For using CountInv() in anons syntax the same but you should explicit define certain value of max amount of checked item, instead of using '0' value.Code: Select all
Ready: SPRT 1 AB { A_WeaponReady; If(A_JumpIfInventory("inventoryitem",0,"state")) { Return state("state"); } Else { Return state(""); } } Loop
I'm trying to use countinv, not a_jumpifinventory.Void Weaver wrote:What?
Code: Select all
if (!A_JumpifInventory("myitem",0,"null"){
int blahblah=countinv("myitem");
int maxitem=blahblah?findinventory("myitem").maxamount:getdefaultbytype("myitem").maxamount;
int roomtoadd=maxitem-blahblah;
//etc.
}
Code: Select all
static clearscope int MaxInv(actor holder,class<inventory> inv){
if(holder.findinventory(inv))return holder.findinventory(inv).maxamount;
return getdefaultbytype(inv).maxamount;
}
Spoiler:Basically, where do I insert the call for the custom function & whatnot? I just want to make sure I don't cock up.