Spoiler
This code is compiled fine:
But this one:
where aClass is surely a class, and newInvClass is defined as:
(edit: invClass is a String)
makes the compiler throw this error:
or this error if I add a check in the parenthesis:
What's the problem with it? I don't often use class limiters.
Code: Select all
//Return:
//-1 - if firstClass is not relationed to secondClass.
//0 - if firstClass is the same class of secondClass.
//1 - if firstClass is child of secondClass;
//2 - if firstClass is parent of secondClass;
static final function int classIsRelatedWith(class firstClass, class secondClass, optional bool bNoSubClass) {
if (firstClass == secondClass)
return 0;
if (!bNoSubClass) {
if (classIsChildOf(firstClass, secondClass))
return 1;
else if (classIsChildOf(secondClass, firstClass))
return 2;
}
return -1;
}
Code: Select all
if (classIsRelatedWith(newInvClass, aClass) >= 0)
Code: Select all
local class<Inventory> newInvClass;
newInvClass = class<Inventory>(DynamicLoadObject(invClass, class'Inventory'));
makes the compiler throw this error:
Code: Select all
Error, Bad or missing expression in 'If'
Code: Select all
Error, Bad or missing expression in parenthesis
Failed due to errors.
I guess this topic can be closed then .o.