- corrected the export signatures of several script exports to contain the correct classes, so that the fudging in FindFunction could be removed.

- fixed PARAM_ACTION_PROLOGUE to assign correct types to the implicit pointers. It gave the actual class to the wrong one, which until now did not matter because all functions were using 'Actor', regardless of actual class association.
- fixed the definition of IceChunk and removed some redundant code here. Since A_FreezeDeathChunks already calls SetState, which in turn calls the state's action function, there is no need to call it again explicitly.
This commit is contained in:
Christoph Oelckers 2016-12-02 18:52:58 +01:00
parent 1e01e6e4df
commit fbf8084999
8 changed files with 56 additions and 87 deletions

View file

@ -583,35 +583,24 @@ FPropertyInfo *FindProperty(const char * string)
AFuncDesc *FindFunction(PStruct *cls, const char * string)
{
for (int i = 0; i < 2; i++)
int min = 0, max = AFTable.Size() - 1;
while (min <= max)
{
// Since many functions have been declared with Actor as owning class, despite being members of something else, let's hack around this until they have been fixed or exported.
// Since most of these are expected to be scriptified anyway, there's no point fixing them all before they get exported.
if (i == 1)
int mid = (min + max) / 2;
int lexval = stricmp(cls->TypeName.GetChars(), AFTable[mid].ClassName + 1);
if (lexval == 0) lexval = stricmp(string, AFTable[mid].FuncName);
if (lexval == 0)
{
if (!cls->IsKindOf(RUNTIME_CLASS(PClassActor))) break;
cls = RUNTIME_CLASS(AActor);
return &AFTable[mid];
}
int min = 0, max = AFTable.Size() - 1;
while (min <= max)
else if (lexval > 0)
{
int mid = (min + max) / 2;
int lexval = stricmp(cls->TypeName.GetChars(), AFTable[mid].ClassName + 1);
if (lexval == 0) lexval = stricmp(string, AFTable[mid].FuncName);
if (lexval == 0)
{
return &AFTable[mid];
}
else if (lexval > 0)
{
min = mid + 1;
}
else
{
max = mid - 1;
}
min = mid + 1;
}
else
{
max = mid - 1;
}
}
return nullptr;

View file

@ -1140,8 +1140,8 @@ class AActor;
// callingstate - State this action was called from
#define PARAM_ACTION_PROLOGUE(type) \
PARAM_PROLOGUE; \
PARAM_OBJECT (self, type); \
PARAM_OBJECT (stateowner, AActor) \
PARAM_OBJECT (self, AActor); \
PARAM_OBJECT (stateowner, type) \
PARAM_POINTER (stateinfo, FStateParamInfo) \
// Number of action paramaters