There are many many cases of this throughout the code base. All of them should be using rotate_map_coordinates. In addition CoordsXY, TileCoordsXY should have a rotate method.
For example this:
switch (trackDirection)
{
default:
case 0:
offsetX = trackBlock->x;
offsetY = trackBlock->y;
break;
case 1:
offsetX = trackBlock->y;
offsetY = -trackBlock->x;
break;
case 2:
offsetX = -trackBlock->x;
offsetY = -trackBlock->y;
break;
case 3:
offsetX = -trackBlock->y;
offsetY = trackBlock->x;
break;
}
Should ideally be:
CoordsXY offsets = { offsetX, offsetY };
CoordsXY track = { trackBlock->x, trackBlock->y };
offsets += track.Rotate(trackDirection);
This:
int16_t tmp;
switch (trackDirection & 3)
{
case 1:
tmp = x;
x = y;
y = -tmp;
break;
case 2:
x = -x;
y = -y;
break;
case 3:
tmp = x;
x = -y;
y = tmp;
break;
case 0:
break;
}
should be:
rotate_map_coordinates(&x, &y);
Me and my team would like to work on this issue, We will update it as we work on it.
Great. Just to warn you I'm adjusting the function track_place so try to avoid that to prevent merge issues.
@bdupree5 did you get round to make an implementation?
Unfortunately we did not. I apologize for forgetting and not letting you know sooner
Once I've finalized the related issue 9288, I'll take on this one as well.
Most helpful comment
Me and my team would like to work on this issue, We will update it as we work on it.