void CJaw::PostSerialize() { BaseClass::PostSerialize(); if(m_auxSlotUsed) { SetViewMode(0); DrawSlot(eIGS_ThirdPersonAux,true); } else if (GetOwner() != 0 && !IsAttachedToBack() && !IsAttachedToHand()) { Hide(true); } else if (!IsOwnerFP()) { SetViewMode(eIVM_ThirdPerson); DrawSlot(eIGS_ThirdPerson, true); DrawSlot(eIGS_ThirdPersonAux,false); } if (m_smokeActive) { Pickalize(false, true); } if (GetOwner() != 0) { CActor* pOwner = GetOwnerActor(); IInventory* pInventory = pOwner ? pOwner->GetInventory() : 0; UnregisterUsedAmmoWithInventory(pInventory); RegisterUsedAmmoWithInventory(pInventory); } }
void CRocketLauncher::PostDropAnim() { CWeapon::Drop(5.0f,true); if(m_fm && GetAmmoCount(m_fm->GetAmmoType())<=0) { Pickalize(false,true); if(m_smokeEffectSlot==-1) { IParticleEffect * pEffect = gEnv->pParticleManager->FindEffect(m_sEmptySmokeEffect.c_str()); if(pEffect) m_smokeEffectSlot = GetEntity()->LoadParticleEmitter(-1,pEffect); } } }
//========================================= void CRocketLauncher::PostSerialize() { CWeapon::PostSerialize(); if(m_auxSlotUsed) { SetViewMode(0); DrawSlot( eIGS_ThirdPersonAux,true); ActivateTPLaser(false); } else DrawSlot( eIGS_ThirdPersonAux,false); if(m_smokeEffectSlot>-1) Pickalize(false,true); }
//------------------------------------------------------------------------ void CItem::OnReset() { //Hidden entities must have physics disabled if(!GetEntity()->IsHidden()) GetEntity()->EnablePhysics(true); DestroyedGeometry(false); m_stats.health = (float)m_properties.hitpoints; UpdateDamageLevel(); if(m_sharedparams->params.scopeAttachment) DrawSlot(eIGS_Aux1,false); //Hide secondary FP scope if (m_properties.mounted && m_sharedparams->params.mountable) { MountAt(GetEntity()->GetWorldPos()); SEntityPhysicalizeParams params; params.mass = 0; params.nSlot = -1; // todo: -1 doesn't work for characters params.type = PE_STATIC; GetEntity()->Physicalize(params); } else { SetViewMode(eIVM_ThirdPerson); if (m_properties.pickable) { const bool hasOwner = (GetOwnerId() != 0); Physicalize(hasOwner ? false : true, m_properties.physics); Pickalize(true, false); } else Physicalize(m_properties.physics, true); } GetEntity()->InvalidateTM(); }
void CJaw::DropUsed() { if (!gEnv->IsEditing()) { m_dropped = true; EnableUpdate(true); Pickalize(false,true); CreateSmokeEffect(); if (g_pGame->GetTacticalManager()) g_pGame->GetTacticalManager()->RemoveEntity(GetEntityId(), CTacticalManager::eTacticalEntity_Item); } if (m_playedDropAction) { DrawSlot(eIGS_ThirdPersonAux, true); DrawSlot(eIGS_ThirdPerson, false); } else { DrawSlot(eIGS_ThirdPersonAux, false); DrawSlot(eIGS_ThirdPerson, true); } }