- disabled the scripted virtual function module after finding out that it only works if each single class that may serve as a parent for scripting is explicitly declared.

Needless to say, this is simply too volatile and would require constant active maintenance, not to mention a huge amount of work up front to get going.
It also hid a nasty problem with the Destroy method. Due to the way the garbage collector works, Destroy cannot be exposed to scripts as-is. It may be called from scripts but it may not be overridden from scripts because the garbage collector can call this function after all data needed for calling a scripted override has already been destroyed because if that data is also being collected there is no guarantee that proper order of destruction is observed. So for now Destroy is just a normal native method to scripted classes
This commit is contained in:
Christoph Oelckers 2016-11-24 21:36:02 +01:00
parent 9ae272d753
commit 66d28a24b8
149 changed files with 727 additions and 759 deletions

View file

@ -667,7 +667,7 @@ public:
bool Final = false; // cannot be overridden
bool Unsafe = false; // Contains references to class fields that are unsafe for psp and item state calls.
BYTE ImplicitArgs = 0; // either 0 for static, 1 for method or 3 for action
int VirtualIndex = -1;
unsigned VirtualIndex = ~0u;
FName Name;
TArray<VMValue> DefaultArgs;
FString PrintableName; // so that the VM can print meaningful info if something in this function goes wrong.

View file

@ -34,15 +34,15 @@
#include <new>
#include "dobject.h"
IMPLEMENT_CLASS(VMException, false, false, false, false)
IMPLEMENT_CLASS(VMFunction, true, true, false, false)
IMPLEMENT_CLASS(VMException, false, false)
IMPLEMENT_CLASS(VMFunction, true, true)
IMPLEMENT_POINTERS_START(VMFunction)
IMPLEMENT_POINTER(Proto)
IMPLEMENT_POINTERS_END
IMPLEMENT_CLASS(VMScriptFunction, false, false, false, false)
IMPLEMENT_CLASS(VMNativeFunction, false, false, false, false)
IMPLEMENT_CLASS(VMScriptFunction, false, false)
IMPLEMENT_CLASS(VMNativeFunction, false, false)
VMScriptFunction::VMScriptFunction(FName name)
{