run OnReady script in CreateUnit

This commit is contained in:
Tim Felgentreff 2022-09-09 07:36:15 +02:00
parent 49f4e88cde
commit 3fc5f5c6ed

View file

@ -802,6 +802,12 @@ static int CclCreateUnit(lua_State *l)
}
UpdateForNewUnit(*unit, 0);
if (unit->Type->OnReady) {
unit->Type->OnReady->pushPreamble();
unit->Type->OnReady->pushInteger(UnitNumber(*unit));
unit->Type->OnReady->run();
}
lua_pushnumber(l, UnitNumber(*unit));
return 1;
}