mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 15:22:15 +00:00
- fixed: The static variant of PClass::FindFunction may only be used for actual static variables.
This commit is contained in:
parent
0e095b0c05
commit
1b07bded47
4 changed files with 10 additions and 3 deletions
|
@ -48,6 +48,7 @@
|
|||
#include "a_keys.h"
|
||||
#include "vm.h"
|
||||
#include "types.h"
|
||||
#include "scriptutil.h"
|
||||
|
||||
// MACROS ------------------------------------------------------------------
|
||||
|
||||
|
@ -255,6 +256,7 @@ void PClass::StaticShutdown ()
|
|||
{
|
||||
*p = nullptr;
|
||||
}
|
||||
ScriptUtil::Clear();
|
||||
FunctionPtrList.Clear();
|
||||
VMFunction::DeleteAll();
|
||||
|
||||
|
|
|
@ -367,8 +367,7 @@ DBaseStatusBar::DBaseStatusBar ()
|
|||
{
|
||||
AltHud = cls->CreateNew();
|
||||
|
||||
VMFunction * func = nullptr;
|
||||
PClass::FindFunction(&func, classname, "Init");
|
||||
VMFunction * func = PClass::FindFunction(classname, "Init");
|
||||
if (func != nullptr)
|
||||
{
|
||||
VMValue params[] = { AltHud };
|
||||
|
|
|
@ -35,6 +35,11 @@
|
|||
static TArray<VMValue> parameters;
|
||||
static TMap<FName, VMFunction*> functions;
|
||||
|
||||
void ScriptUtil::Clear()
|
||||
{
|
||||
parameters.Clear();
|
||||
functions.Clear();
|
||||
}
|
||||
|
||||
void ScriptUtil::BuildParameters(va_list ap)
|
||||
{
|
||||
|
@ -69,7 +74,7 @@ void ScriptUtil::RunFunction(FName functionname, unsigned paramstart, VMReturn &
|
|||
auto check = functions.CheckKey(functionname);
|
||||
if (!check)
|
||||
{
|
||||
PClass::FindFunction(&func, NAME_ScriptUtil, functionname);
|
||||
func = PClass::FindFunction(NAME_ScriptUtil, functionname);
|
||||
if (func == nullptr)
|
||||
{
|
||||
I_Error("Call to undefined function ScriptUtil.%s", functionname.GetChars());
|
||||
|
|
|
@ -24,4 +24,5 @@ public:
|
|||
};
|
||||
|
||||
static int Exec(FName functionname, ...);
|
||||
static void Clear();
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue