From 5bc89e7efcda661f5a2ebc5ffdc1b59ebb5f0eda Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 12 Nov 2016 00:57:21 +0100 Subject: [PATCH] - added a VM handler for PostBeginPlay. - made a few changes to let the templates compile again on Linux. --- src/virtual.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/virtual.h b/src/virtual.h index 377ec2ce8..188519f71 100644 --- a/src/virtual.h +++ b/src/virtual.h @@ -34,6 +34,7 @@ VMEXPORTED_NATIVES_START VMEXPORTED_NATIVES_FUNC(Destroy) VMEXPORTED_NATIVES_FUNC(Tick) + VMEXPORTED_NATIVES_FUNC(PostBeginPlay) VMEXPORTED_NATIVES_FUNC(DropInventory) VMEXPORTED_NATIVES_END @@ -71,9 +72,9 @@ private: public: void Destroy() { - if (ObjectFlags & OF_SuperCall) + if (this->ObjectFlags & OF_SuperCall) { - ObjectFlags &= OF_SuperCall; + this->ObjectFlags &= OF_SuperCall; ExportedNatives::Get()->template Destroy(this); } else @@ -90,13 +91,19 @@ public: // Without the type cast this picks the 'void *' assignment... VMValue params[1] = { (DObject*)this }; VMFrameStack stack; - stack.Call(GetClass()->Virtuals[VIndex], params, 1, nullptr, 0, nullptr); + stack.Call(this->GetClass()->Virtuals[VIndex], params, 1, nullptr, 0, nullptr); } } void Tick() { ExportedNatives::Get()->template Tick(this); } + + void PostBeginPlay() + { + ExportedNatives::Get()->template PostBeginPlay(this); + } + AInventory *DropInventory(AInventory *item) { return ExportedNatives::Get()->template DropInventory(this, item); @@ -124,7 +131,8 @@ VMEXPORT_NATIVES_END(DObject) VMEXPORT_NATIVES_START(DThinker, DObject) VMEXPORT_NATIVES_FUNC(Tick) -VMEXPORT_NATIVES_END(DThinker) + VMEXPORT_NATIVES_FUNC(PostBeginPlay) + VMEXPORT_NATIVES_END(DThinker) VMEXPORT_NATIVES_START(AActor, DThinker) VMEXPORT_NATIVES_FUNC(DropInventory)