Bazaar developer reference

luaL_optbool(lua_State *, int, bool)

Defined in
Lua/CvLuaSupport.cpp, line 28
Hook name
CivHooks::luaL_optbool

Hooks

static bool BeforeluaL_optbool(lua_State* L, int idx, bool bdefault, bool& result);static void AfterluaL_optbool(lua_State* L, int idx, bool bdefault, bool& result);static bool ReplaceluaL_optbool(bool (*original)(lua_State*, int, bool), lua_State* L, int idx, bool bdefault);CivRegisterBefore<CivHooks::luaL_optbool>(host, &BeforeluaL_optbool);CivRegisterAfter<CivHooks::luaL_optbool>(host, &AfterluaL_optbool);CivRegisterReplace<CivHooks::luaL_optbool>(host, &ReplaceluaL_optbool);

Code

28bool luaL_optbool(lua_State* L, int idx, bool bdefault)29{30	if(lua_isnoneornil(L, idx))31	{32		return bdefault;33	}34	else35	{36		return (bool)lua_toboolean(L, idx);37	}38}

Calls

Called by

43 functions in 6 files