Bazaar developer reference

CvLuaUnit::lKill(lua_State *)

Defined in
Lua/CvLuaUnit.cpp, line 672
Class
CvLuaUnit
Hook name
CivHooks::CvLuaUnit_lKill

Hooks

static bool BeforeCvLuaUnit_lKill(lua_State* L, int& result);static void AfterCvLuaUnit_lKill(lua_State* L, int& result);static int ReplaceCvLuaUnit_lKill(int (*original)(lua_State*), lua_State* L);CivRegisterBefore<CivHooks::CvLuaUnit_lKill>(host, &BeforeCvLuaUnit_lKill);CivRegisterAfter<CivHooks::CvLuaUnit_lKill>(host, &AfterCvLuaUnit_lKill);CivRegisterReplace<CivHooks::CvLuaUnit_lKill>(host, &ReplaceCvLuaUnit_lKill);

Code

671//void kill(bool bDelay, PlayerTypes ePlayer = NO_PLAYER);672int CvLuaUnit::lKill(lua_State* L)673{674	CvUnit* pkUnit = GetInstance(L);675	const bool bDelay = lua_toboolean(L, 2);676	const PlayerTypes ePlayer677	    = (lua_isnil(L, 3))? NO_PLAYER : (PlayerTypes)lua_tointeger(L, 3);678679	pkUnit->kill(bDelay, ePlayer);680	return 0;681}

Calls

Called by