Hooks
static bool BeforeCvLuaCity_lPushOrder(lua_State* L, int& result);static void AfterCvLuaCity_lPushOrder(lua_State* L, int& result);static int ReplaceCvLuaCity_lPushOrder(int (*original)(lua_State*), lua_State* L);CivRegisterBefore<CivHooks::CvLuaCity_lPushOrder>(host, &BeforeCvLuaCity_lPushOrder);CivRegisterAfter<CivHooks::CvLuaCity_lPushOrder>(host, &AfterCvLuaCity_lPushOrder);CivRegisterReplace<CivHooks::CvLuaCity_lPushOrder>(host, &ReplaceCvLuaCity_lPushOrder);
Code
4118//void pushOrder(OrderTypes eOrder, int iData1, int iData2, bool bSave, bool bPop, bool bAppend, bool bForce);4119int CvLuaCity::lPushOrder(lua_State* L)4120{4121 CvCity* pkCity = GetInstance(L);4122 const OrderTypes eOrder = (OrderTypes)lua_tointeger(L, 2);4123 const int iData1 = lua_tointeger(L, 3);4124 const int iData2 = lua_tointeger(L, 4);4125 const bool bSave = lua_tointeger(L, 5); // While this looks like a bug (should be lua_toboolean), fixing it will break a large number of game core .lua files!4126 const bool bPop = lua_toboolean(L, 6);4127 const bool bAppend = lua_toboolean(L, 7);4128 const bool bForce = luaL_optint(L, 8, 0);4129 pkCity->pushOrder(eOrder, iData1, iData2, bSave, bPop, bAppend, bForce);41304131 return 1;4132}