Hooks
static bool BeforeCvLuaTeam_lMakePeace(lua_State* L, int& result);static void AfterCvLuaTeam_lMakePeace(lua_State* L, int& result);static int ReplaceCvLuaTeam_lMakePeace(int (*original)(lua_State*), lua_State* L);CivRegisterBefore<CivHooks::CvLuaTeam_lMakePeace>(host, &BeforeCvLuaTeam_lMakePeace);CivRegisterAfter<CivHooks::CvLuaTeam_lMakePeace>(host, &AfterCvLuaTeam_lMakePeace);CivRegisterReplace<CivHooks::CvLuaTeam_lMakePeace>(host, &ReplaceCvLuaTeam_lMakePeace);
Code
320//void makePeace(TeamTypes eTeam);321int CvLuaTeam::lMakePeace(lua_State* L)322{323#if defined(MOD_EVENTS_WAR_AND_PEACE)324 CvTeam* pkTeam = GetInstance(L);325 TeamTypes eOtherTeam = (TeamTypes)lua_tointeger(L, 2);326 const bool bBumpUnits = luaL_optbool(L, 3, true);327 const bool bSuppressNotification = luaL_optbool(L, 4, false);328 PlayerTypes eOriginatingPlayer = (PlayerTypes)luaL_optint(L, 5, -1);329330 pkTeam->makePeace(eOtherTeam, bBumpUnits, bSuppressNotification, eOriginatingPlayer);331 return 0;332#else333 return BasicLuaMethod(L, &CvTeam::makePeace);334#endif335}