# HG changeset patch # User rubidium # Date 2009-08-26 20:26:40 # Node ID 9422ba5131c9fb9af11c38a7df95a7f4ef5adb57 # Parent b06338602f224fa08cbe262e3388662cc523be6d (svn r17291) -Fix [FS#3147]: crash after upgrading base graphics/sound set when opening the game options menu and you were using the upgraded set diff --git a/src/base_media_func.h b/src/base_media_func.h --- a/src/base_media_func.h +++ b/src/base_media_func.h @@ -159,6 +159,11 @@ bool BaseMedia::AddFile(const /* don't allow recursive delete of all remaining items */ duplicate->next = NULL; + /* If the duplicate set is currently used (due to rescanning this can happen) + * update the currently used set to the new one. This will 'lie' about the + * version number until a new game is started which isn't a big problem */ + if (BaseMedia::used_set == duplicate) BaseMedia::used_set = set; + DEBUG(grf, 1, "Removing %s (%i) as base " SET_TYPE " set (duplicate)", duplicate->name, duplicate->version); delete duplicate; ret = true; diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -100,10 +100,12 @@ public: case CONTENT_TYPE_BASE_GRAPHICS: BaseGraphics::FindSets(); + InvalidateWindow(WC_GAME_OPTIONS, 0); break; case CONTENT_TYPE_BASE_SOUNDS: BaseSounds::FindSets(); + InvalidateWindow(WC_GAME_OPTIONS, 0); break; case CONTENT_TYPE_NEWGRF: