Skip to content

Commit

Permalink
Fix OpenTTD#7609, OpenTTD#7165: In the sprite aligner window the 'Res…
Browse files Browse the repository at this point in the history
…et relative' button crashes the game.

The 'offs_start_map' is a 'SmallMap', so its own 'Erase' function should be called instead of the underlying vector's 'erase' function.
And fix a "typo". :)
  • Loading branch information
stormcone committed May 26, 2019
1 parent ef74af6 commit 44c9ee2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/newgrf_debug_gui.cpp
Expand Up @@ -972,7 +972,7 @@ struct SpriteAlignerWindow : Window {
this->offs_start_map.Insert(this->current_sprite, XyOffs(spr->x_offs, spr->y_offs));
}
switch (widget) {
/* Move ten units at a time if ctrl is pressed. */
/* Move eight units at a time if ctrl is pressed. */
case WID_SA_UP: spr->y_offs -= _ctrl_pressed ? 8 : 1; break;
case WID_SA_DOWN: spr->y_offs += _ctrl_pressed ? 8 : 1; break;
case WID_SA_LEFT: spr->x_offs -= _ctrl_pressed ? 8 : 1; break;
Expand All @@ -986,7 +986,7 @@ struct SpriteAlignerWindow : Window {

case WID_SA_RESET_REL:
/* Reset the starting offsets for the current sprite. */
this->offs_start_map.erase(this->offs_start_map.begin() + this->current_sprite);
this->offs_start_map.Erase(this->current_sprite);
this->SetDirty();
break;
}
Expand Down

0 comments on commit 44c9ee2

Please sign in to comment.