Skip to content

[Bug]: Non-snap turrets throw errors when small enemy in range, but not visible behind low obstacles #4518

@Keshash

Description

@Keshash

Complete the template below. Reports that do not follow the template will be deleted.
Title should be: [Bug]: (Short description of bug)

Specifications
Please provide the following.

Rimworld version: 1.6.4630
Combat Extended version: 21.03.2026 dev snapshot
Combat Extended source (Steam, GitHub, etc.):
Your operating system: windows
Your mod list: minimal

Description
Provide a concise description of the issue or concern. What happened?

When a non-snap turret has an enemy in range behind itself, but cannot shoot it because the enemy is too tiny and can't be seen behind a passable obstacle (rock, sandbag), it starts spamming selection weight errors

Expected behavior
What did you expect to happen?
no errors

To reproduce
Provide clear steps to reproduce the behavior. How do we make this happen?

  1. clear rect 100x100 area
  2. Pause the game
  3. build 90mm flak turret in center, load it with ammo and man it. By default, it will be looking north.
  4. Spawn a megascarab south of the turret within turret's range
  5. build a sandbag between megascarab and turret, so that it cant be seen behind it
  6. unpause and let turret try to find target on its own, without forcing fire.

Screenshots & log dumps

i lost the player log, unfortunately. But you can see stack trace on 2nd screenshot

Image Image

Complete the following checklist
I hereby verify that I have done the following:

  • Confirmed that my game version and load order are correct.
  • Confirmed that I am running the appropriate and most updated version of Combat Extended and required compatibility patches.
  • Confirmed I am not running any mods with known incompatibilities with Combat Extended.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions