Remove unnecessary branching from ToCPos
This commit is contained in:
@@ -56,8 +56,7 @@ namespace OpenRA
|
|||||||
// (b) Therefore:
|
// (b) Therefore:
|
||||||
// - au + 2bv adds (a + b) to (x, y)
|
// - au + 2bv adds (a + b) to (x, y)
|
||||||
// - a correction factor is added if v is odd
|
// - a correction factor is added if v is odd
|
||||||
var offset = (V & 1) == 1 ? 1 : 0;
|
var y = (V - (V & 1)) / 2 - U;
|
||||||
var y = (V - offset) / 2 - U;
|
|
||||||
var x = V - y;
|
var x = V - y;
|
||||||
return new CPos(x, y);
|
return new CPos(x, y);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user