summaryrefslogtreecommitdiff
path: root/src/newgrf_debug_gui.cpp
diff options
context:
space:
mode:
authorstormcone <48624099+stormcone@users.noreply.github.com>2019-05-27 00:52:53 +0200
committerCharles Pigott <charlespigott@googlemail.com>2019-06-06 17:28:39 +0100
commit6396ec05fe9ce865a8642231bdb75b45cfb19627 (patch)
tree3b92266042000238a8e928a6cef9dcf0df62a4a7 /src/newgrf_debug_gui.cpp
parent846fc8fe097689ef2fa1498708b3244fb4ad84ac (diff)
downloadopenttd-6396ec05fe9ce865a8642231bdb75b45cfb19627.tar.xz
Fix #7609: In the sprite aligner window the 'Reset 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". :)
Diffstat (limited to 'src/newgrf_debug_gui.cpp')
-rw-r--r--src/newgrf_debug_gui.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/newgrf_debug_gui.cpp b/src/newgrf_debug_gui.cpp
index 47bd60e37..4abdb5198 100644
--- a/src/newgrf_debug_gui.cpp
+++ b/src/newgrf_debug_gui.cpp
@@ -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;
@@ -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;
}