Add a lua call back when game ends : CleanGame_Lua.
This commit is contained in:
parent
8f88ea441f
commit
1944bfa6fb
3 changed files with 17 additions and 0 deletions
src
|
@ -341,6 +341,8 @@ void FreeNumberDesc(NumberDesc *number); /// Free number description content. (
|
|||
void FreeUnitDesc(UnitDesc *unitdesc); /// Free unit description content. (no pointer itself).
|
||||
void FreeStringDesc(StringDesc *s); /// Frre string description content. (no pointer itself).
|
||||
|
||||
// call the lua function: CleanGame_Lua.
|
||||
void CleanGame_Lua();
|
||||
|
||||
//@}
|
||||
|
||||
|
|
|
@ -2834,4 +2834,18 @@ void SaveCcl(CFile &file)
|
|||
file.printf("SetSpeedResearch(%d)\n", SpeedResearch);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void CleanGame_Lua()
|
||||
{
|
||||
lua_getglobal(Lua, "CleanGame_Lua");
|
||||
if (lua_isfunction(Lua, -1)) {
|
||||
LuaCall(0, 1);
|
||||
} else {
|
||||
lua_pop(Lua, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//@}
|
||||
|
|
|
@ -403,6 +403,7 @@ void CleanGame()
|
|||
EndReplayLog();
|
||||
CleanMessages();
|
||||
|
||||
CleanGame_Lua();
|
||||
CleanTriggers();
|
||||
CleanAi();
|
||||
CleanGroups();
|
||||
|
|
Loading…
Add table
Reference in a new issue