From 6396ec05fe9ce865a8642231bdb75b45cfb19627 Mon Sep 17 00:00:00 2001 From: stormcone <48624099+stormcone@users.noreply.github.com> Date: Mon, 27 May 2019 00:52:53 +0200 Subject: 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". :) --- src/newgrf_debug_gui.cpp | 4 ++-- 1 file 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; } -- cgit v1.2.3-70-g09d2