I am having trouble getting a pawn class to compile. The error is Type mismatch in 'If' in the line: if( MyInventory[inc] == int (x) );
CODE: [CODE]class BSAPawn extends UTPawn;
var() array MyInventory;
function bool HasItem(int x) { local int len; local int inc; len = MyInventory.Length;
for(inc = 0; inc < len; inc++)
{
if( MyInventory[inc] = int x );
return true;
}
return false;
}[/CODE]
Does anyone know how to sort this out? Tom
You're assigning a value
=
instead of doing a comparison==
it should look like..
Plus why are you using
int x
instead of simplyx