Bazaar developer reference

CvLuaUnit::lIsNearSapper(lua_State *)

Defined in
Lua/CvLuaUnit.cpp, line 4710
Class
CvLuaUnit
Hook name
CivHooks::CvLuaUnit_lIsNearSapper

Hooks

static bool BeforeCvLuaUnit_lIsNearSapper(lua_State* L, int& result);static void AfterCvLuaUnit_lIsNearSapper(lua_State* L, int& result);static int ReplaceCvLuaUnit_lIsNearSapper(int (*original)(lua_State*), lua_State* L);CivRegisterBefore<CivHooks::CvLuaUnit_lIsNearSapper>(host, &BeforeCvLuaUnit_lIsNearSapper);CivRegisterAfter<CivHooks::CvLuaUnit_lIsNearSapper>(host, &AfterCvLuaUnit_lIsNearSapper);CivRegisterReplace<CivHooks::CvLuaUnit_lIsNearSapper>(host, &ReplaceCvLuaUnit_lIsNearSapper);

Code

4709//bool IsNearSapper(CvCity* pTargetCity);4710int CvLuaUnit::lIsNearSapper(lua_State* L)4711{4712	CvUnit* pkUnit = GetInstance(L);4713	CvCity* pkCity = CvLuaCity::GetInstance(L, 2, false);47144715	const bool bResult = pkUnit->IsNearSapper(pkCity);4716	lua_pushboolean(L, bResult);4717	return 1;4718}

Calls

Called by