Hooks
static bool BeforeCvLuaGame_lCanHandleAction(lua_State* L, int& result);static void AfterCvLuaGame_lCanHandleAction(lua_State* L, int& result);static int ReplaceCvLuaGame_lCanHandleAction(int (*original)(lua_State*), lua_State* L);CivRegisterBefore<CivHooks::CvLuaGame_lCanHandleAction>(host, &BeforeCvLuaGame_lCanHandleAction);CivRegisterAfter<CivHooks::CvLuaGame_lCanHandleAction>(host, &AfterCvLuaGame_lCanHandleAction);CivRegisterReplace<CivHooks::CvLuaGame_lCanHandleAction>(host, &ReplaceCvLuaGame_lCanHandleAction);
Code
459// bool CanHandleAction(int iAction, CvPlot* pPlot, bool bTestVisible)460int CvLuaGame::lCanHandleAction(lua_State* L)461{462 const int iAction = lua_tointeger(L, 1);463 CvPlot* pkPlot = CvLuaPlot::GetInstance(L, 2, false);464 const bool bTestVisible = luaL_optbool(L, 3, 0);465 const bool bResult = GetInstance()->canHandleAction(iAction, pkPlot, bTestVisible);466 lua_pushboolean(L, bResult);467 return 1;468}