Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void __thiscall CPed__initWeaponClump(CPed *ped, int modelID)
- {
- CPed *_ped;
- CBaseModelInfo *weaponModel;
- int weapClump;
- int pedtype;
- int weapSlotOffset;
- CWeaponSlot *weapSlot;
- int hAnimHier;
- int boneIndex;
- int pMatrices;
- int molotovParticle;
- RwV3D pos;
- _ped = ped;
- if ( modelID != -1 )
- {
- if ( !ped->weaponSlots[ped->m_bActiveWeapon].field_15 )
- {
- weaponModel = modelPtrs[modelID];
- if ( ped->WeaponClump )
- CPed__removeWeaponModel(ped, -1);
- weapClump = (*(weaponModel->__vmt + 0x2C))(weaponModel); // CModelBase::createInstance
- _ped->WeaponClump = weapClump;
- if ( weapClump )
- _ped->WeaponGunflashClump = findObjectByNodeName(weapClump, "gunflash");
- else
- _ped->WeaponGunflashClump = 0;
- CModelBase__addRef(weaponModel);
- pedtype = _ped->pedType;
- _ped->field_740 = modelID;
- if ( !pedtype || pedtype == 1 )
- {
- weapSlotOffset = 28 * _ped->m_bActiveWeapon;
- weapSlot = (_ped->weaponSlots + weapSlotOffset);
- if ( weapSlot->type == WEAPON_MOLOTOV )
- {
- if ( modelID == MODEL_MOLOTOV )
- {
- if ( !*(&_ped->weaponSlots[0].particle + weapSlotOffset) )
- {
- hAnimHier = clumpGetFirstSkinAtomicHAnimHierarchy(_ped->__parent.__parent.m_pRWObject);
- boneIndex = RpHAnimIDGetIndex(hAnimHier, BONE_RIGHTWRIST);
- pMatrices = RpHAnimHierarchyGetMatrixArray(hAnimHier);
- LODWORD(pos.x) = 0;
- LODWORD(pos.y) = 0;
- LODWORD(pos.z) = 0;
- molotovParticle = createParticle("molotov_flame", &pos, ((boneIndex * 64) + pMatrices), 0);
- weapSlot->particle = molotovParticle;
- if ( molotovParticle )
- {
- sub_4AA910(1);
- dummy_4AA890(weapSlot->particle);
- CParticle__init(weapSlot->particle);
- }
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement