Changeset - r11130:91c5a54741ad
[Not reviewed]
master
0 1 0
rubidium - 15 years ago 2009-02-14 01:42:12
rubidium@openttd.org
(svn r15476) -Fix [FS#2630]: crash when opening the game options when the currently loaded base graphics pack has less than 2 valid graphics files. For example when someone replaces all his/her original base graphics with custom work (but keeps the name) or renames the dos ones to windows or vice versa.
1 file changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/gfxinit.cpp
Show inline comments
 
@@ -577,7 +577,7 @@ int GetNumGraphicsSets()
 
{
 
	int n = 0;
 
	for (const GraphicsSet *g = _available_graphics_sets; g != NULL; g = g->next) {
 
		if (g->found_grfs <= 1) continue;
 
		if (g != _used_graphics_set && g->found_grfs <= 1) continue;
 
		n++;
 
	}
 
	return n;
 
@@ -590,8 +590,8 @@ int GetIndexOfCurrentGraphicsSet()
 
{
 
	int n = 0;
 
	for (const GraphicsSet *g = _available_graphics_sets; g != NULL; g = g->next) {
 
		if (g == _used_graphics_set) return n;
 
		if (g->found_grfs <= 1) continue;
 
		if (g == _used_graphics_set) return n;
 
		n++;
 
	}
 
	return -1;
 
@@ -603,7 +603,7 @@ int GetIndexOfCurrentGraphicsSet()
 
const char *GetGraphicsSetName(int index)
 
{
 
	for (const GraphicsSet *g = _available_graphics_sets; g != NULL; g = g->next) {
 
		if (g->found_grfs <= 1) continue;
 
		if (g != _used_graphics_set && g->found_grfs <= 1) continue;
 
		if (index == 0) return g->name;
 
		index--;
 
	}
0 comments (0 inline, 0 general)