Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Why is it crash when calling MMCIP_SECONDARY without equipped PRIMARY?

Be a kicker than cheater.
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.
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;
 
Back
Top