Bazaar developer reference

CvLuaPlayer::lAddNotification(lua_State *)

Defined in
Lua/CvLuaPlayer.cpp, line 9039
Class
CvLuaPlayer
Hook name
CivHooks::CvLuaPlayer_lAddNotification

Hooks

static bool BeforeCvLuaPlayer_lAddNotification(lua_State* L, int& result);static void AfterCvLuaPlayer_lAddNotification(lua_State* L, int& result);static int ReplaceCvLuaPlayer_lAddNotification(int (*original)(lua_State*), lua_State* L);CivRegisterBefore<CivHooks::CvLuaPlayer_lAddNotification>(host, &BeforeCvLuaPlayer_lAddNotification);CivRegisterAfter<CivHooks::CvLuaPlayer_lAddNotification>(host, &AfterCvLuaPlayer_lAddNotification);CivRegisterReplace<CivHooks::CvLuaPlayer_lAddNotification>(host, &ReplaceCvLuaPlayer_lAddNotification);

Code

9038//void AddNotification()9039int CvLuaPlayer::lAddNotification(lua_State* L)9040{9041	CvPlayerAI* pkPlayer = GetInstance(L);9042	CvNotifications* pNotifications = pkPlayer->GetNotifications();9043	int notificationID = -1;9044	if(pNotifications)9045	{9046		int iExtraData = -1;9047		if(lua_gettop(L) >= 8)9048			iExtraData = lua_tointeger(L, 8);90499050		notificationID = pNotifications->Add((NotificationTypes) lua_tointeger(L, 2),9051		                                     lua_tostring(L, 3),9052		                                     lua_tostring(L, 4),9053		                                     lua_tointeger(L, 5),9054		                                     lua_tointeger(L, 6),9055		                                     lua_tointeger(L, 7),9056		                                     iExtraData);9057	}9058	lua_pushinteger(L, notificationID);90599060	return 1;9061}

Calls

Called by