Why is it crash when calling MMCIP_SECONDARY without equipped PRIMARY?

Results 1 to 2 of 2
  1. #1
    Be a kicker than cheater. cheaterastic is offline
    MemberRank
    Dec 2009 Join Date
    764Posts

    Why is it crash when calling MMCIP_SECONDARY without equipped PRIMARY?

    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;


  2. #2
    Be a kicker than cheater. cheaterastic is offline
    MemberRank
    Dec 2009 Join Date
    764Posts

    Re: Why is it crash when calling MMCIP_SECONDARY without equipped PRIMARY?

    Sorry for this post, I found out that the crash is not because of this.
    Thank you for reading.



Advertisement