xray-16 icon indicating copy to clipboard operation
xray-16 copied to clipboard

Clear Sky: Missing variable in gun setting file

Open sobkas opened this issue 1 year ago • 6 comments

Crash when some weapons(eg. wpn_val) with built in suppressor don't have snd_silncer_shot only snd_shoot

sobkas avatar May 20 '24 18:05 sobkas

I just checked the difference between CS and COP sources: image

CS code was trying to use sndSilencerShot only if silencer attached and is actually attachable/detachable, assuming the use of normal sndShot when there's no silencer or it's built-in. In COP SilencerAttachable() check was commented out.

The most natural fix would be checking for sndSilencerShot existence in InitAddons function on line 1068. Replace this:

    if (IsSilencerAttached() /* && SilencerAttachable() */)

With this:

    if (IsSilencerAttached() && m_layered_sounds.FindSoundItem("sndSilencerShot", false))

Please, change the code accordingly!

Xottab-DUTY avatar May 21 '24 02:05 Xottab-DUTY

I just checked the difference between CS and COP sources: image

CS code was trying to use sndSilencerShot only if silencer attached and is actually attachable/detachable, assuming the use of normal sndShot when there's no silencer or it's built-in. In COP SilencerAttachable() check was commented out.

The most natural fix would be checking for sndSilencerShot existence in InitAddons function on line 1068. Replace this:

    if (IsSilencerAttached() /* && SilencerAttachable() */)

With this:

    if (IsSilencerAttached() && m_layered_sounds.FindSoundItem("sndSilencerShot", false))

Please, change the code accordingly!

Well it fixes also other problem I have found wpn_pb

sobkas avatar May 21 '24 17:05 sobkas

Well it fixes also other problem I have found wpn_pb

What was that problem?

Xottab-DUTY avatar Jun 01 '24 15:06 Xottab-DUTY

Well it fixes also other problem I have found wpn_pb

What was that problem?

It doesn't have silencer_light_color and family(all silencer_light_*) So when it tries to use any of them it crashes.

;silencer_flame_particles = weapons\generic_weapon03 ;silencer_smoke_particles = weapons\generic_shoot_00

;silencer_light_color = 0.6, 0.5, 0.3 ;silencer_light_range = 0.01 ;silencer_light_var_color = 0.05 ;silencer_light_var_range = 0.5 ;silencer_light_time = 0.2

sobkas avatar Jun 02 '24 11:06 sobkas

t1.zip When used with SRP_v1.1.4:Optional Features/#2. (Choose From This Folder Last)/Alternative Ballistics it causes crash

sobkas avatar Jun 03 '24 23:06 sobkas

Without it merged or getting feedback I can't continue to test Clear Sky support

sobkas avatar Jul 22 '24 21:07 sobkas

Sorry, for the long long delay in the review and merge.

There were some uncertainties I wanted to check and it turned out that they were not groundless. I've fixed everything and a bit more!

Xottab-DUTY avatar Dec 27 '24 17:12 Xottab-DUTY