Changeset - r14717:163e5bb4aabf
[Not reviewed]
master
0 1 0
yexo - 14 years ago 2010-03-04 20:07:39
yexo@openttd.org
(svn r19315) -Fix (r19295): Show the filename in the newgrf windows if the newgrf name is not empty
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/newgrf_config.cpp
Show inline comments
 
@@ -22,49 +22,49 @@
 

	
 
GRFConfig::GRFConfig(const char *filename)
 
{
 
	if (filename != NULL) this->filename = strdup(filename);
 
}
 

	
 
GRFConfig::~GRFConfig()
 
{
 
	/* GCF_COPY as in NOT strdupped/alloced the filename, name and info */
 
	if (!HasBit(this->flags, GCF_COPY)) {
 
		free(this->filename);
 
		free(this->name);
 
		free(this->info);
 
		delete this->error;
 
	}
 
}
 

	
 
/**
 
 * Get the name of this grf. In case the name isn't known
 
 * the filename is returned.
 
 * @return The name of filename of this grf.
 
 */
 
const char *GRFConfig::GetName() const
 
{
 
	if (this->name == NULL) return this->filename;
 
	if (StrEmpty(this->name)) return this->filename;
 
	return this->name;
 
}
 

	
 
/**
 
 * Get the grf info.
 
 * @return A string with a description of this grf.
 
 */
 
const char *GRFConfig::GetDescription() const
 
{
 
	return this->info;
 
}
 

	
 
GRFConfig *_all_grfs;
 
GRFConfig *_grfconfig;
 
GRFConfig *_grfconfig_newgame;
 
GRFConfig *_grfconfig_static;
 

	
 
GRFError::GRFError(StringID severity, StringID message) :
 
	message(message),
 
	severity(severity)
 
{
 
}
 

	
 
GRFError::~GRFError()
0 comments (0 inline, 0 general)