(svn r10114) -Fix: Only load newgrf error messages if the language matches the current
language. Since only one error can be loaded anyway, if the language didn't match you'd get "Undefined string". Also since we're only loading one language there's no need to use AddGRFString any more.
This commit is contained in:
@@ -97,7 +97,12 @@ void ClearGRFConfig(GRFConfig **config)
|
||||
free((*config)->full_path);
|
||||
free((*config)->name);
|
||||
free((*config)->info);
|
||||
free((*config)->error);
|
||||
|
||||
if ((*config)->error != NULL) {
|
||||
free((*config)->error->custom_message);
|
||||
free((*config)->error->data);
|
||||
free((*config)->error);
|
||||
}
|
||||
}
|
||||
free(*config);
|
||||
*config = NULL;
|
||||
@@ -134,6 +139,8 @@ GRFConfig **CopyGRFConfigList(GRFConfig **dst, const GRFConfig *src)
|
||||
if (src->error != NULL) {
|
||||
c->error = CallocT<GRFError>(1);
|
||||
memcpy(c->error, src->error, sizeof(GRFError));
|
||||
if (src->error->data != NULL) c->error->data = strdup(src->error->data);
|
||||
if (src->error->custom_message != NULL) c->error->custom_message = strdup(src->error->custom_message);
|
||||
}
|
||||
|
||||
*dst = c;
|
||||
|
Reference in New Issue
Block a user