Browse Source

Comment about calling `AcediaActor`'s constructors

pull/8/head
Anton Tarasenko 4 years ago
parent
commit
bd91b8fd85
  1. 3
      sources/Memory/MemoryAPI.uc
  2. 3
      sources/Types/AcediaActor.uc

3
sources/Memory/MemoryAPI.uc

@ -106,6 +106,9 @@ public final function Object Allocate(
AcediaObject(allocatedObject)._constructor();
}
if (acediaActorClassToAllocate != none) {
// Despite `_constructor()` being called during `PreBeginPlay()` event,
// we must also call it here for `Actor`s that we did not spawn anew,
// but took from object pool.
AcediaActor(allocatedObject)._constructor();
}
return allocatedObject;

3
sources/Types/AcediaActor.uc

@ -412,6 +412,9 @@ public static final function Global __()
event PreBeginPlay()
{
super.PreBeginPlay();
// Calling this early here makes sure `Actor`s that catch `PreBeginPlay()`
// and similar early initialization events will find global API already
// setup and working
_constructor();
}

Loading…
Cancel
Save