SmartlyDressedGames / Unturned-3.x-Community

Community portion of the Unturned-3.x repo. If you have access to the source code you can find it here:
https://github.com/SmartlyDressedGames/Unturned-3.x/
84 stars 18 forks source link

Spread-reducing attachments don't affect guns in sentries #4357

Closed MoltonMontro closed 1 month ago

MoltonMontro commented 4 months ago

Certain attachment properties don't seem to affect guns while they're placed in turrets.

Skimming through InteractableSentry, it looks like spread-reducing attachments should increase the turret's accuracy, but I'm having issues with recreating this in-game. Normally-accurate weapons (w/out attachments) seem to be performing better than spread-reduced weapons (w/ attachments), even if the latter is more accurate while held by the player. Maybe this broke when Spread_Aim was replaced with Spread_Angle_Degrees?


Tangential, but damage-changing properties don't work either. I'm not sure if they ever affected gun turrets, but they probably should do something since some attachment properties do work (e.g. Braked).

SDGNelson commented 4 months ago

Fair points about both. There's a lot of weird things with sentries and it's quite unfortunate that the gun code is duplicated between them and actual guns - this is why in 4 the code was shared. Currently sentries have a random chance of hitting the player which is affected by the spread value, but only the hipfire spread which I suppose should be changed. 🤢

MoltonMontro commented 3 months ago

This is a bit more tangential, but ItemGunAsset's Ammo_Per_Shot (e.g., Ammo_Per_Shot 0 for infinite ammo) does not work with sentries either. Infinite_Ammo true does work, but isn't viable for non-zero Ammo_Per_Shot values.

SDGNelson commented 3 months ago

These should be fixed for the next update! I significantly changed the chance to hit affect of spread: Previously it only used the hipfire spread value and could never hit past 45 degrees of spread. Now it uses the aiming spread and can hit up all the way up to 90 degrees. We'll have to see if there's any feedback about it. 😟