- fixed: All functions that are callable from weapon states and not members of Actor need to be declared 'action'.

With the stricter type checks of the self pointer that were now implemented these all produced errors.
This commit is contained in:
Christoph Oelckers 2016-11-13 14:20:30 +01:00
commit a2f4cd7cda
38 changed files with 185 additions and 237 deletions

View file

@ -2317,7 +2317,14 @@ FxExpression *ZCCCompiler::SetupActionFunction(PClass *cls, ZCC_TreeNode *af)
{
FArgumentList argumentlist;
// We can use this function directly without wrapping it in a caller.
return new FxVMFunctionCall(new FxSelf(*af), afd, argumentlist, *af, false);
if ((afd->Variants[0].Flags & VARF_Action) || !cls->IsDescendantOf(RUNTIME_CLASS(AStateProvider)) || !afd->Variants[0].SelfClass->IsDescendantOf(RUNTIME_CLASS(AStateProvider)))
{
return new FxVMFunctionCall(new FxSelf(*af), afd, argumentlist, *af, false);
}
else
{
Error(af, "Cannot use non-action function %s here.", FName(id->Identifier).GetChars());
}
}
}
else