Make SetLevelFunc and GetLevelFunc only store the function in m_levelFuncs.

Store the function in m_levelFuncs instead of the table itself.
This commit is contained in:
hispidence 2021-08-30 18:21:42 +01:00
parent b5d8fe06ad
commit 70cc036605
2 changed files with 16 additions and 15 deletions

View file

@ -60,17 +60,17 @@ class GameScript : public LuaHandler
{
private:
LuaVariables m_globals{};
LuaVariables m_locals{};
DisplayStringMap m_userDisplayStrings{};
std::unordered_map<std::string, VarMapVal> m_nameMap{};
std::unordered_map<std::string, short> m_itemsMapName{};
std::unordered_set<std::string> m_levelFuncs{};
sol::protected_function m_onStart{};
sol::protected_function m_onLoad{};
sol::protected_function m_onControlPhase{};
sol::protected_function m_onSave{};
sol::protected_function m_onEnd{};
LuaVariables m_globals{};
LuaVariables m_locals{};
DisplayStringMap m_userDisplayStrings{};
std::unordered_map<std::string, VarMapVal> m_nameMap{};
std::unordered_map<std::string, short> m_itemsMapName{};
std::unordered_map<std::string, sol::protected_function> m_levelFuncs{};
sol::protected_function m_onStart{};
sol::protected_function m_onLoad{};
sol::protected_function m_onControlPhase{};
sol::protected_function m_onSave{};
sol::protected_function m_onEnd{};
void ResetLevelTables();