Hooks
static bool BeforeCvLuaUnit_lSetXY(lua_State* L, int& result);static void AfterCvLuaUnit_lSetXY(lua_State* L, int& result);static int ReplaceCvLuaUnit_lSetXY(int (*original)(lua_State*), lua_State* L);CivRegisterBefore<CivHooks::CvLuaUnit_lSetXY>(host, &BeforeCvLuaUnit_lSetXY);CivRegisterAfter<CivHooks::CvLuaUnit_lSetXY>(host, &AfterCvLuaUnit_lSetXY);CivRegisterReplace<CivHooks::CvLuaUnit_lSetXY>(host, &ReplaceCvLuaUnit_lSetXY);
Code
3646//void setXY(int iX, int iY, bool bGroup = false, bool bUpdate = true, bool bShow = false, bCheckPlotVisible = false);3647int CvLuaUnit::lSetXY(lua_State* L)3648{3649 CvUnit* pkUnit = GetInstance(L);3650 const int x = lua_tointeger(L, 2);3651 const int y = lua_tointeger(L, 3);3652 const bool bGroup = luaL_optint(L, 4, 0);3653 const bool bUpdate = luaL_optint(L, 5, 1);3654 const bool bShow = luaL_optint(L, 6, 0);3655 const bool bCheckPlotVisible = luaL_optint(L, 7, 0);36563657 pkUnit->setXY(x, y, bGroup, bUpdate, bShow, bCheckPlotVisible);3658 return 0;3659}