@@ -88,9 +88,9 @@ void CWeaponMagazined::Load(LPCSTR section)
8888
8989 // Alundaio: LAYERED_SND_SHOOT
9090#ifdef LAYERED_SND_SHOOT
91- m_layered_sounds.LoadSound (section, " snd_shoot" , " sndShot" , true , m_eSoundShot);
91+ m_layered_sounds.LoadSound (section, " snd_shoot" , " sndShot" , false , m_eSoundShot);
9292#else
93- m_sounds.LoadSound (section, " snd_shoot" , " sndShot" , true , m_eSoundShot); // Alundaio: Set exclusive to true
93+ m_sounds.LoadSound (section, " snd_shoot" , " sndShot" , false , m_eSoundShot);
9494#endif
9595 // -Alundaio
9696
@@ -114,7 +114,17 @@ void CWeaponMagazined::Load(LPCSTR section)
114114 if (pSettings->line_exist (section, " silencer_smoke_particles" ))
115115 m_sSilencerSmokeParticles = pSettings->r_string (section, " silencer_smoke_particles" );
116116
117+ // Alundaio: LAYERED_SND_SHOOT Silencer
118+ #ifdef LAYERED_SND_SHOOT
119+ m_layered_sounds.LoadSound (section, " snd_silncer_shot" , " sndSilencerShot" , false , m_eSoundShot);
120+ if (WeaponSoundExist (section, " snd_silncer_shot_actor" ))
121+ m_layered_sounds.LoadSound (section, " snd_silncer_shot_actor" , " sndSilencerShotActor" , false , m_eSoundShot);
122+ #else
117123 m_sounds.LoadSound (section, " snd_silncer_shot" , " sndSilencerShot" , false , m_eSoundShot);
124+ if (WeaponSoundExist (section, " snd_silncer_shot_actor" ))
125+ m_sounds.LoadSound (section, " snd_silncer_shot_actor" , " sndSilencerShotActor" , false , m_eSoundShot);
126+ #endif
127+ // -Alundaio
118128 }
119129
120130 m_iBaseDispersionedBulletsCount = READ_IF_EXISTS (pSettings, r_u8, section, " base_dispersioned_bullets_count" , 0 );
@@ -183,7 +193,7 @@ void CWeaponMagazined::FireStart()
183193 { // misfire
184194 // Alundaio
185195#ifdef EXTENDED_WEAPON_CALLBACKS
186- CGameObject *object = smart_cast<CGameObject*>(H_Parent ());
196+ CGameObject *object = smart_cast<CGameObject*>(H_Parent ());
187197 if (object)
188198 object->callback (GameObject::eOnWeaponJammed)(object->lua_game_object (), this ->lua_game_object ());
189199#endif
@@ -629,7 +639,7 @@ void CWeaponMagazined::OnShot()
629639#ifdef LAYERED_SND_SHOOT
630640 m_layered_sounds.PlaySound (m_sSndShotCurrent.c_str (), get_LastFP (), H_Root (), !!GetHUDmode (), false , (u8 )-1 );
631641#else
632- PlaySound (m_sSndShotCurrent.c_str (), get_LastFP (), (u8 )(m_iShotNum - 1 ) ); // Alundaio: Play sound at index (ie. snd_shoot, snd_shoot1, snd_shoot2, snd_shoot3)
642+ PlaySound (m_sSndShotCurrent.c_str (), get_LastFP (), (u8 )- 1 ); // Alundaio: Play sound at index (ie. snd_shoot, snd_shoot1, snd_shoot2, snd_shoot3)
633643#endif
634644 // -Alundaio
635645
@@ -1194,7 +1204,7 @@ void CWeaponMagazined::OnZoomIn()
11941204
11951205 // Alundaio: callback not sure why vs2013 gives error, it's fine
11961206#ifdef EXTENDED_WEAPON_CALLBACKS
1197- CGameObject *object = smart_cast<CGameObject*>(H_Parent ());
1207+ CGameObject *object = smart_cast<CGameObject*>(H_Parent ());
11981208 if (object)
11991209 object->callback (GameObject::eOnWeaponZoomIn)(object->lua_game_object (),this ->lua_game_object ());
12001210#endif
@@ -1223,13 +1233,13 @@ void CWeaponMagazined::OnZoomOut()
12231233 if (GetState () == eIdle)
12241234 PlayAnimIdle ();
12251235
1226- // Alundaio
1236+ // Alundaio
12271237#ifdef EXTENDED_WEAPON_CALLBACKS
1228- CGameObject *object = smart_cast<CGameObject*>(H_Parent ());
1229- if (object)
1230- object->callback (GameObject::eOnWeaponZoomOut)(object->lua_game_object (), this ->lua_game_object ());
1238+ CGameObject *object = smart_cast<CGameObject*>(H_Parent ());
1239+ if (object)
1240+ object->callback (GameObject::eOnWeaponZoomOut)(object->lua_game_object (), this ->lua_game_object ());
12311241#endif
1232- // -Alundaio
1242+ // -Alundaio
12331243
12341244 CActor* pActor = smart_cast<CActor*>(H_Parent ());
12351245
@@ -1453,7 +1463,11 @@ bool CWeaponMagazined::install_upgrade_impl(LPCSTR section, bool test)
14531463 result2 = process_if_exists_set (section, " snd_shoot" , &CInifile::r_string, str, test);
14541464 if (result2 && !test)
14551465 {
1466+ #ifdef LAYERED_SND_SHOOT
1467+ m_layered_sounds.LoadSound (section, " snd_shoot" , " sndShot" , false , m_eSoundShot);
1468+ #else
14561469 m_sounds.LoadSound (section, " snd_shoot" , " sndShot" , false , m_eSoundShot);
1470+ #endif
14571471 }
14581472 result |= result2;
14591473
@@ -1494,7 +1508,11 @@ bool CWeaponMagazined::install_upgrade_impl(LPCSTR section, bool test)
14941508 result2 = process_if_exists_set (section, " snd_silncer_shot" , &CInifile::r_string, str, test);
14951509 if (result2 && !test)
14961510 {
1511+ #ifdef LAYERED_SND_SHOOT
1512+ m_layered_sounds.LoadSound (section, " snd_silncer_shot" , " sndSilencerShot" , false , m_eSoundShot);
1513+ #else
14971514 m_sounds.LoadSound (section, " snd_silncer_shot" , " sndSilencerShot" , false , m_eSoundShot);
1515+ #endif
14981516 }
14991517 result |= result2;
15001518 }
0 commit comments