Skip to content

Instantly share code, notes, and snippets.

@mattkimber
Last active May 1, 2021 12:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattkimber/e2dab2f47f45d975faa2d77c61e5ea9d to your computer and use it in GitHub Desktop.
Save mattkimber/e2dab2f47f45d975faa2d77c61e5ea9d to your computer and use it in GitHub Desktop.
Vehicle reversal problem
void Vehicle::UpdateViewport(bool dirty)
{
Rect old_coord = this->sprite_cache.old_coord;
this->UpdateBoundingBoxCoordinates(true);
if (old_coord.left == INVALID_COORD) {
UpdateVehicleViewportHash(this, this->coord.left, this->coord.top, old_coord.left, old_coord.top);
} else {
UpdateVehicleViewportHash(this, this->coord.left, this->coord.top, this->sprite_cache.old_coord.left, this->sprite_cache.old_coord.top);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment