extended onCreateGame functionality

now also trips on object instances and datablock namespaces
ensures there's a generic hook for post-load processing for objects created by a scene to reference other objects created during that process
This commit is contained in:
AzaezelX 2024-01-21 22:16:15 -06:00
parent bd2121b674
commit cf56265789

View file

@ -139,7 +139,7 @@ function loadMissionStage3()
// Construct MOD paths
pathOnMissionLoadDone();
getRootScene().callOnChildren("onCreateGame");
// Mission loading done...
echo("*** Mission loaded");
@ -152,6 +152,16 @@ function loadMissionStage3()
%hasGameMode = callGamemodeFunction("onMissionStart");
}
function GameBase::onCreateGame(%this)
{
%db = %this.getDatablock();
if (%db.isMethod("onCreateGame"))
{
%db.onCreateGame(%this);
}
}
function endMission()
{
if (!isObject( getScene(0) ))