- Joined
- Dec 17, 2009
- Messages
- 726
- Reaction score
- 25
My Runnable is crashing whenever I call the MMCIP_SECONDARY without equipped weapon to MMCIP_PRIMARY. Also is MMCIP_CUSTOM2 without equipped MMCIP_CUSTOM1
I can't figured out what the caused of this. I do not know if this is because of MMCIP_PRIMARY or MMCIP_SECONDARY. I am calling the weapon of pAttacker, not myCharacter.
Here is the code.
I can't figured out what the caused of this. I do not know if this is because of MMCIP_PRIMARY or MMCIP_SECONDARY. I am calling the weapon of pAttacker, not myCharacter.
Here is the code.
Code:
MMatchWeaponType wtype = MWT_NONE;
ZItem* pSItem = pAttacker->m_Items.GetItem(MMCIP_PRIMARY);
MMatchItemDesc* pSelectedItemDesc = NULL;
if( pSItem ) {
pSelectedItemDesc = pSItem->GetDesc();
}
if( pSelectedItemDesc ) {
wtype = pSelectedItemDesc->m_nWeaponType.Ref();
}
if(pSItem){
if(pSelectedItemDesc){
if(MWT_ROCKET == wtype){
nItemID = pSelectedItemDesc->m_nID;
}
}
}
if(!nItemID)
nItemID = pAttacker->m_Items.GetItem(MMCIP_SECONDARY)->GetDesc()->m_nID;