Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GBC: Remove another crash source #3997

Merged
merged 2 commits into from Jul 16, 2020

Conversation

esainane
Copy link
Contributor

This happened whenever there was an unidentified enemy very, very
close to the location of a soon-to-be build site.

This could only really happen when:

  • you're building something on the frontline
  • you're using GBC to do so
  • you don't have clear los to the build site
  • you do have clear radar coverage of the build site

This meant it was both very rare, and typically happened in moments
where you really don't want to take time out to go bug hunting.

It's even harder to reproduce locally unless you knew what
you were looking for, since global spec control (for positioning
enemy units) was usually paired with globallos, which prevents
this condition from happening.

This happened whenever there was an unidentified enemy very, very
close to the location of a soon-to-be build site.

This could only really happen when:
 - you're building something on the frontline
 - you're using GBC to do so
 - you don't have clear los to the build site
 - you do have clear radar coverage of the build site

This meant it was both very rare, and typically happened in moments
where you really don't want to take time out to go bug hunting.

It's even harder to reproduce locally unless you knew what
you were looking for, since global spec control (for positioning
enemy units) was usually paired with globallos, which prevents
this condition from happening.
@sprunk
Copy link
Member

sprunk commented Jul 16, 2020

Looks good. Maybe put the GetUnitTeam == myTeam check in front of the unitDef.humanName check instead though? This way unitDef won't be indexed for enemies and it's probably a cheaper check than string parsing as well.

@esainane
Copy link
Contributor Author

Ideally it'd save UnitDefNames.terraunit.id to a local once, then check against that every time it's needed, which is how other widgets have done it. Touching GBC is always slightly terrifying, but should be fine here.

@sprunk sprunk merged commit 4393b18 into ZeroK-RTS:master Jul 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants