Bazaar developer reference

CvLuaUnit::lFlavorValue(lua_State *)

Defined in
Lua/CvLuaUnit.cpp, line 2013
Class
CvLuaUnit
Hook name
CivHooks::CvLuaUnit_lFlavorValue

Hooks

static bool BeforeCvLuaUnit_lFlavorValue(lua_State* L, int& result);static void AfterCvLuaUnit_lFlavorValue(lua_State* L, int& result);static int ReplaceCvLuaUnit_lFlavorValue(int (*original)(lua_State*), lua_State* L);CivRegisterBefore<CivHooks::CvLuaUnit_lFlavorValue>(host, &BeforeCvLuaUnit_lFlavorValue);CivRegisterAfter<CivHooks::CvLuaUnit_lFlavorValue>(host, &AfterCvLuaUnit_lFlavorValue);CivRegisterReplace<CivHooks::CvLuaUnit_lFlavorValue>(host, &ReplaceCvLuaUnit_lFlavorValue);

Code

2012//int flavorValue(int /*FlavorTypes*/ eFlavor);2013int CvLuaUnit::lFlavorValue(lua_State* L)2014{2015	CvUnit* pkUnit = GetInstance(L);2016	const FlavorTypes eFlavor = (FlavorTypes)lua_tointeger(L, 2);20172018	const int iResult = pkUnit->flavorValue(eFlavor);2019	lua_pushinteger(L, iResult);2020	return 1;2021}

Calls

Called by