Issue when comparing classes.
void main()
{
object oCreature = OBJECT_SELF;
int nFirstClass = GetClassByPosition(1, oCreature);
if (nFirstClass != CLASS_TYPE_FIGHTER)
SendMessageToPC(GetFirstPC(), "Bing");
else
SendMessageToPC(GetFirstPC(), "Bong");
}
This is a cut out of an OnDeath script meant to check whether or not a class is a base NWN class or a custom NWN class/Prestige Class.
The issue that, in this case, on the death of a level 1 fighter the result of 'bing' is displayed despite the fact that it should be showing 'bong' as it is a fighter.
0
Comments
Maybe the function returns CLASS_TYPE_INVALID if the creature is dead?