aliens

Author Topic: Shotgun accuracy  (Read 3220 times)

Offline omri

  • Squaddie
  • *
  • Posts: 7
    • View Profile
Shotgun accuracy
« on: July 26, 2022, 12:52:49 am »
There seams to be a bug in computing the accuracy of shotgun pellets, after the first one.
This may fix it, or maybe someone could explain to me what I am not understanding.
If this is indeed a bug, and is fixed, shotguns may need to be rebalanced in mods that use them.

---                                                                             
 src/Battlescape/ProjectileFlyBState.cpp | 2 +-                                 
 1 file changed, 1 insertion(+), 1 deletion(-)                                 
                                                                               
diff --git a/src/Battlescape/ProjectileFlyBState.cpp b/src/Battlescape/ProjectileFlyBState.cpp
index 6b151e4d5..012f3766a 100644                                               
--- a/src/Battlescape/ProjectileFlyBState.cpp                                   
+++ b/src/Battlescape/ProjectileFlyBState.cpp                                   
@@ -587,7 +587,7 @@ void ProjectileFlyBState::think()                           
                            // create a projectile                             
                            Projectile *proj = new Projectile(_parent->getMod(), _parent->getSave(), _action, _origin, _targetVoxel, _ammo);
                            // let it trace to the point where it hits         
-                           int secondaryImpact = proj->calculateTrajectory(std::max(0.0, (_unit->getFiringAccuracy(_action.type, _action.weapon) / 100.0) - i * 5.0));
+                           int secondaryImpact = proj->calculateTrajectory(std::max(0.0, (_unit->getFiringAccuracy(_action.type, _action.weapon) - i * 5.0) / 100.0));
                            if (secondaryImpact != V_EMPTY)                     
                            {                                                   
                                // as above: skip the shot to the end of it's path
--                                                                             
2.37.1                                                                         
 

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9098
    • View Profile
Re: Shotgun accuracy
« Reply #1 on: July 26, 2022, 10:26:35 am »

Offline omri

  • Squaddie
  • *
  • Posts: 7
    • View Profile
Re: Shotgun accuracy
« Reply #2 on: July 26, 2022, 02:40:39 pm »
If it should be 0, why not code it as 0, instead of 500% dropoff from something which is never that large?
It would make the code a lot easier to understand.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9098
    • View Profile
Re: Shotgun accuracy
« Reply #3 on: July 26, 2022, 02:55:02 pm »
it 'should' be 0.05, not 0

the "why" question was answered: "... i got a decent spread to begin with, and never changed it."

if the answer is not satisfactory, you can talk to Warboy again (nobody else can answer it for him)... or you can just use other suggested options