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