- scriptified two of the Acolyte's functions.
- added a DActorIterator class. - fixed: It was not possible to have functions of the same name in two different classes because the name they were searched for was not qualified by the class. Changed so that the class name is included now, but to avoid renaming several hundreds of functions all at once, if the search fails, it will repeat with 'Actor' as class name. This commit contains preparations for scriptifying Hexen's Dragon, but that doesn't work yet so it's not included.
This commit is contained in:
parent
a2e17c0ab5
commit
633da6e5d8
32 changed files with 334 additions and 260 deletions
|
|
@ -571,28 +571,33 @@ FPropertyInfo *FindProperty(const char * string)
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
AFuncDesc *FindFunction(const char * string)
|
||||
AFuncDesc *FindFunction(PClass *cls, const char * string)
|
||||
{
|
||||
int min = 0, max = AFTable.Size()-1;
|
||||
|
||||
while (min <= max)
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
int mid = (min + max) / 2;
|
||||
int lexval = stricmp (string, AFTable[mid].Name);
|
||||
if (lexval == 0)
|
||||
if (i == 1 && !cls->IsDescendantOf(RUNTIME_CLASS(AActor))) break;
|
||||
FStringf fullname("%s_%s", i == 0 ? cls->TypeName.GetChars() : "Actor", string);
|
||||
int min = 0, max = AFTable.Size() - 1;
|
||||
|
||||
while (min <= max)
|
||||
{
|
||||
return &AFTable[mid];
|
||||
}
|
||||
else if (lexval > 0)
|
||||
{
|
||||
min = mid + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
max = mid - 1;
|
||||
int mid = (min + max) / 2;
|
||||
int lexval = stricmp(fullname, AFTable[mid].Name + 1);
|
||||
if (lexval == 0)
|
||||
{
|
||||
return &AFTable[mid];
|
||||
}
|
||||
else if (lexval > 0)
|
||||
{
|
||||
min = mid + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
max = mid - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -627,7 +632,7 @@ static int propcmp(const void * a, const void * b)
|
|||
|
||||
static int funccmp(const void * a, const void * b)
|
||||
{
|
||||
return stricmp( ((AFuncDesc*)a)->Name, ((AFuncDesc*)b)->Name);
|
||||
return stricmp(((AFuncDesc*)a)->Name + 1, ((AFuncDesc*)b)->Name + 1); // +1 to get past the prefix letter of the native class name, which gets omitted by the FName for the class.
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue