run OnReady script in CreateUnit
This commit is contained in:
parent
49f4e88cde
commit
3fc5f5c6ed
1 changed files with 6 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue