An example could be if I subclass a particular Botpack weapon, but want to detect the original.
I thought about doing these:
Code: Select all
function bool isSpecificEnforcer(Inventory inv) {
local Enforcer enf;
enf = Enforcer(inv);
if(enf != None) {
//inv is an enforcer, but could be a subclass?
return true;
}
if(inv.IsA('Enforcer') ){
//inv is an enforcer, but could be a subclass?
return true;
}
if(inv.Class == class'Enforcer') {
//inv class is EXACTLY an enforcer?
return true;
}
return false;
}