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

Fix FindActorsOnLine overscan #13894

Merged
merged 1 commit into from Aug 26, 2017

Conversation

Projects
None yet
3 participants
@reaperrr
Contributor

reaperrr commented Aug 24, 2017

Fixes #13851.

In addition to AreaBeam, this would also affect Railgun and BlocksProjectiles.

@reaperrr reaperrr added this to the Next Release milestone Aug 24, 2017

@reaperrr

This comment has been minimized.

Show comment
Hide comment
@reaperrr

reaperrr Aug 24, 2017

Contributor

Updated.

Contributor

reaperrr commented Aug 24, 2017

Updated.

@pchote

pchote approved these changes Aug 24, 2017

// xDir and yDir must never be 0, otherwise the overscan will be 0 in the respective direction.
var xDiff = lineEnd.X - lineStart.X;
var yDiff = lineEnd.Y - lineStart.Y;
var xDir = xDiff < 0 ? -1 : 1;

This comment has been minimized.

@pchote

pchote Aug 24, 2017

Member

For anyone wondering why 1 and not -1: it doesn't matter. We define the box of actors to select by subtracting this from the start point and adding it to the end point. In both cases it balances out to select +/- overscan perpendicular to the line.

@pchote

pchote Aug 24, 2017

Member

For anyone wondering why 1 and not -1: it doesn't matter. We define the box of actors to select by subtracting this from the start point and adding it to the end point. In both cases it balances out to select +/- overscan perpendicular to the line.

@pchote pchote added the PR: Needs +2 label Aug 24, 2017

@chrisforbes chrisforbes merged commit b1c63a4 into OpenRA:bleed Aug 26, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@reaperrr reaperrr deleted the reaperrr:fix-FindActorsOnLine branch Nov 11, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment