Hooks
static bool BeforeCvLuaMap_lPlotDistance(lua_State* L, int& result);static void AfterCvLuaMap_lPlotDistance(lua_State* L, int& result);static int ReplaceCvLuaMap_lPlotDistance(int (*original)(lua_State*), lua_State* L);CivRegisterBefore<CivHooks::CvLuaMap_lPlotDistance>(host, &BeforeCvLuaMap_lPlotDistance);CivRegisterAfter<CivHooks::CvLuaMap_lPlotDistance>(host, &AfterCvLuaMap_lPlotDistance);CivRegisterReplace<CivHooks::CvLuaMap_lPlotDistance>(host, &ReplaceCvLuaMap_lPlotDistance);
Code
363int CvLuaMap::lPlotDistance(lua_State* L)364{365 int iX1 = lua_tointeger(L, 1);366 int iY1 = lua_tointeger(L, 2);367 int iX2 = lua_tointeger(L, 3);368 int iY2 = lua_tointeger(L, 4);369370 int iRetVal = plotDistance(iX1, iY1, iX2, iY2);371372 lua_pushinteger(L, iRetVal);373 return 1;374}