当前位置: 首页>>代码示例>>C++>>正文


C++ CGrenade::u_EventSend方法代码示例

本文整理汇总了C++中CGrenade::u_EventSend方法的典型用法代码示例。如果您正苦于以下问题:C++ CGrenade::u_EventSend方法的具体用法?C++ CGrenade::u_EventSend怎么用?C++ CGrenade::u_EventSend使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CGrenade的用法示例。


在下文中一共展示了CGrenade::u_EventSend方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: PutNextToSlot

void CGrenade::PutNextToSlot()
{
	if (OnClient()) return;

	VERIFY									(!getDestroy());
	//выкинуть гранату из инвентар¤
	NET_Packet						P;
	if (m_pInventory)
	{
		m_pInventory->Ruck					(this);

		this->u_EventGen				(P, GEG_PLAYER_ITEM2RUCK, this->H_Parent()->ID());
		P.w_u16							(this->ID());
		this->u_EventSend				(P);
	}
	else
		Msg ("! PutNextToSlot : m_pInventory = NULL [%d][%d]", ID(), Device.dwFrame);	

	if (smart_cast<CInventoryOwner*>(H_Parent()) && m_pInventory)
	{
		CGrenade *pNext						= smart_cast<CGrenade*>(	m_pInventory->Same(this,true)		);
		if(!pNext) pNext					= smart_cast<CGrenade*>(	m_pInventory->SameSlot(GRENADE_SLOT, this, true)	);

		VERIFY								(pNext != this);

		if(pNext && m_pInventory->Slot(pNext->BaseSlot(),pNext) )
		{
			pNext->u_EventGen				(P, GEG_PLAYER_ITEM2SLOT, pNext->H_Parent()->ID());
			P.w_u16							(pNext->ID());
			P.w_u16							(pNext->BaseSlot());
			pNext->u_EventSend				(P);
			m_pInventory->SetActiveSlot		(pNext->BaseSlot());
		}else
		{
			CActor* pActor = smart_cast<CActor*>( m_pInventory->GetOwner());
			
			if(pActor)
				pActor->OnPrevWeaponSlot();
		}

		m_thrown				= false;
	}
}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:43,代码来源:Grenade.cpp

示例2: PutNextToSlot

void CGrenade::PutNextToSlot()
{
	if (OnClient()) return;
	VERIFY									(!getDestroy());

	//выкинуть гранату из инвентар¤
	if (m_pCurrentInventory)
	{
		NET_Packet						P;
		m_pCurrentInventory->Ruck		(this);
#if defined(GRENADE_FROM_BELT)
		this->u_EventGen				(P, GEG_PLAYER_ITEM2BELT, this->H_Parent()->ID());
#else
		this->u_EventGen				(P, GEG_PLAYER_ITEM2RUCK, this->H_Parent()->ID());
#endif
		P.w_u16							(this->ID());
		this->u_EventSend				(P);
#if defined(GRENADE_FROM_BELT)
		CGrenade *pNext					= smart_cast<CGrenade*>(	m_pCurrentInventory->Same(this,false)		);
		if(!pNext) 
			pNext						= smart_cast<CGrenade*>(	m_pCurrentInventory->SameSlot(GRENADE_SLOT, this, false)	);
#else
		CGrenade *pNext					= smart_cast<CGrenade*>(	m_pCurrentInventory->Same(this,true)		);
		if(!pNext) 
			pNext						= smart_cast<CGrenade*>(	m_pCurrentInventory->SameSlot(GRENADE_SLOT, this, true)	);
#endif

		VERIFY							(pNext != this);

		if(pNext && m_pCurrentInventory->Slot(pNext) )
		{
			pNext->u_EventGen			(P, GEG_PLAYER_ITEM2SLOT, pNext->H_Parent()->ID());
			P.w_u16						(pNext->ID());
			pNext->u_EventSend			(P);
			m_pCurrentInventory->SetActiveSlot(pNext->GetSlot());
		}
/////	m_thrown				= false;
	}
}
开发者ID:,项目名称:,代码行数:39,代码来源:

示例3: PutNextToSlot

void CGrenade::PutNextToSlot()
{
	if (OnClient()) return;
//	Msg ("* PutNextToSlot : %d", ID());	
	VERIFY									(!getDestroy());
	//выкинуть гранату из инвентар¤
	NET_Packet						P;
	if (m_pInventory)
	{
		m_pInventory->Ruck					(this);
//.		m_pInventory->SetActiveSlot			(NO_ACTIVE_SLOT);

		this->u_EventGen				(P, GEG_PLAYER_ITEM2RUCK, this->H_Parent()->ID());
		P.w_u16							(this->ID());
		this->u_EventSend				(P);
	}
	else
		Msg ("! PutNextToSlot : m_pInventory = 0");	

	if (smart_cast<CInventoryOwner*>(H_Parent()) && m_pInventory)
	{
		CGrenade *pNext						= smart_cast<CGrenade*>(	m_pInventory->Same(this,true)		);
		if(!pNext) pNext					= smart_cast<CGrenade*>(	m_pInventory->SameSlot(this,true)	);

		VERIFY								(pNext != this);

		if(pNext && m_pInventory->Slot(pNext) ){

			pNext->u_EventGen				(P, GEG_PLAYER_ITEM2SLOT, pNext->H_Parent()->ID());
			P.w_u16							(pNext->ID());
			pNext->u_EventSend				(P);
//			if(IsGameTypeSingle())			
				m_pInventory->SetActiveSlot			(pNext->GetSlot());
		}

		m_thrown				= false;
	}
}
开发者ID:OLR-xray,项目名称:XRay-NEW,代码行数:38,代码来源:Grenade.cpp


注:本文中的CGrenade::u_EventSend方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。