本文整理汇总了C++中CGrenade::BaseSlot方法的典型用法代码示例。如果您正苦于以下问题:C++ CGrenade::BaseSlot方法的具体用法?C++ CGrenade::BaseSlot怎么用?C++ CGrenade::BaseSlot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGrenade
的用法示例。
在下文中一共展示了CGrenade::BaseSlot方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Action
bool CGrenade::Action(u16 cmd, u32 flags)
{
if(inherited::Action(cmd, flags)) return true;
switch(cmd)
{
//переключение типа гранаты
case kWPN_NEXT:
{
if(flags&CMD_START)
{
if(m_pInventory)
{
TIItemContainer::iterator it = m_pInventory->m_ruck.begin();
TIItemContainer::iterator it_e = m_pInventory->m_ruck.end();
for(;it!=it_e;++it)
{
CGrenade *pGrenade = smart_cast<CGrenade*>(*it);
if(pGrenade && xr_strcmp(pGrenade->cNameSect(), cNameSect()))
{
m_pInventory->Ruck (this);
m_pInventory->SetActiveSlot (NO_ACTIVE_SLOT);
m_pInventory->Slot (pGrenade->BaseSlot(),pGrenade);
return true;
}
}
return true;
}
}
return true;
};
}
return false;
}
示例2: 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;
}
}