Skip to content

Conversation

Quanteey
Copy link
Member

About the PR

Fixed the IK-30 spread bug when the weapon is wielded

Technical details

It inherits from BaseGunWieldable, which by default has a GunWieldBonusComponent

  - type: GunWieldBonus
    minAngle: -20
    maxAngle: -30

The issue is that SharedWieldableSystem literally adds these values onto the base values:

private void OnGunRefreshModifiers(Entity<GunWieldBonusComponent> bonus, ref GunRefreshModifiersEvent args)
{
    if (TryComp(bonus, out WieldableComponent? wield) &&
        wield.Wielded)
    {
        args.MinAngle += bonus.Comp.MinAngle;
        args.MaxAngle += bonus.Comp.MaxAngle;
        args.AngleDecay += bonus.Comp.AngleDecay;
        args.AngleIncrease += bonus.Comp.AngleIncrease;
    }
}

The IK-30 (and the IK-60 inheriting from it) had a base minAngle of 1 and maxAngle of 4, causing these values to be negative, with maxAngle being smaller than minAngle.

I fixed it by simply adding a GunWieldBonus with 0-0 angles to the IK-30. The other alternative is to rework BaseGunWieldable but it's upstream territory.

A test should probably be written to scan for occurrences of this bug, since it's really easy to accidentally run into. But that should probably be done upstream.

Requirements

  • I have tested all added content and changes.
  • I have added media to this PR or it does not require an ingame showcase.

Changelog

🆑

  • fix: Fixed IK-30 and IK-60 spread glitches when wielded

@Quanteey Quanteey requested a review from a team as a code owner August 17, 2025 12:46
@github-actions github-actions bot added size/XS Under 16 lines Changes: YML Changes any yml files S: Needs Review labels Aug 17, 2025
@Stop-Signs
Copy link
Contributor

Direction approval not needed, this is good to merge from us.

@deltanedas deltanedas merged commit d195dc5 into DeltaV-Station:master Aug 17, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changes: YML Changes any yml files S: Needs Review size/XS Under 16 lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants