(svn r18699) -Fix [FS#PlanetAndy]: GRF parameters were not properly initialised to zero, and not always checked for valid range.

This commit is contained in:
frosch
2010-01-03 19:29:56 +00:00
parent f82c591022
commit 666c856457
3 changed files with 27 additions and 11 deletions

View File

@@ -62,8 +62,8 @@ static inline uint32 GetVariable(const ResolverObject *object, byte variable, by
case 0x7D: return _temp_store.Get(parameter);
case 0x7F:
if (object == NULL || object->grffile == NULL || parameter >= object->grffile->param_end) return 0;
return object->grffile->param[parameter];
if (object == NULL || object->grffile == NULL) return 0;
return object->grffile->GetParam(parameter);
/* Not a common variable, so evalute the feature specific variables */
default: return object->GetVariable(object, variable, parameter, available);