- reviewed all places where VARF_Action and NAP were used and fixed what was still wrong.

This commit is contained in:
Christoph Oelckers 2016-10-22 18:13:54 +02:00
parent 371712c53a
commit 37914223f0
5 changed files with 20 additions and 17 deletions

View file

@ -38,7 +38,7 @@
**
*/
#include "actor.h"
#include "a_pickups.h"
#include "info.h"
#include "sc_man.h"
#include "tarray.h"
@ -602,16 +602,16 @@ void ParseFunctionParameters(FScanner &sc, PClassActor *cls, TArray<FxExpression
int pnum = 0;
bool zeroparm;
if (afd->Variants[0].Flags & VARF_Method)
if (afd->Variants[0].Flags & VARF_Action)
{
numparams -= NAP;
pnum += NAP;
}
else if (afd->Variants[0].Flags & VARF_Method)
{
numparams--;
pnum++;
}
if (afd->Variants[0].Flags & VARF_Action)
{
numparams -= 2;
pnum += 2;
}
assert(numparams >= 0);
zeroparm = numparams == 0;
if (numparams > 0 && !(paramflags[pnum] & VARF_Optional))

View file

@ -143,7 +143,7 @@ PFunction *CreateAnonymousFunction(PClass *containingclass, PType *returntype, i
SetImplicitArgs(&args, &argflags, &argnames, containingclass, flags);
PFunction *sym = new PFunction(containingclass, NAME_None); // anonymous functions do not have names.
sym->AddVariant(NewPrototype(rets, args), argflags, argnames, nullptr, VARF_Action|VARF_Method);
sym->AddVariant(NewPrototype(rets, args), argflags, argnames, nullptr, flags);
return sym;
}

View file

@ -32,7 +32,7 @@
**
*/
#include "actor.h"
#include "a_pickups.h"
#include "thingdef.h"
#include "sc_man.h"
#include "c_console.h"