Skip to content

LGTM.com - false positive - missed conditional increment of a variable #3791

@mlangsdorf

Description

@mlangsdorf

Description of the false positive
I keep getting a "Comparison is always false because dif_steering <= 0." error on https://lgtm.com/projects/g/CleverRaven/Cataclysm-DDA/rev/pr-f7153dbafa3dbb084b7793d0d2ac10ebda2bca84

in https://lgtm.com/projects/g/CleverRaven/Cataclysm-DDA/snapshot/912bd27fe5b356ed2a34f3ce5b19e63ad5c9c4cd/files/src/veh_interact.cpp?sort=name&dir=ASC&mode=heatmap#L737, it's clear that dif_steering can be incremented to be more than 5, so this result is in error.

Also, I didn't actually change this part of the file, so I even if there was a false positive, I shouldn't be getting warned about it for this particular PR.

**https://lgtm.com/projects/g/CleverRaven/Cataclysm-DDA/rev/pr-f7153dbafa3dbb084b7793d0d2ac10ebda2bca84
**

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions