diff options
author | frosch <frosch@openttd.org> | 2011-11-08 17:27:13 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2011-11-08 17:27:13 +0000 |
commit | 52774235eb6eb8affb7e68b94c490d3f09e7ae31 (patch) | |
tree | af07d5b6df28b5c9fdcef94e0f67ecec290e1764 /src/newgrf_animation_base.h | |
parent | 30874b5e81af0fff2f42d34b9b105ee86666b8ac (diff) | |
download | openttd-52774235eb6eb8affb7e68b94c490d3f09e7ae31.tar.xz |
(svn r23148) -Change: [NewGRF] Check the results of various callbacks for validness.
Diffstat (limited to 'src/newgrf_animation_base.h')
-rw-r--r-- | src/newgrf_animation_base.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/newgrf_animation_base.h b/src/newgrf_animation_base.h index a3463adb2..695831faa 100644 --- a/src/newgrf_animation_base.h +++ b/src/newgrf_animation_base.h @@ -45,7 +45,10 @@ struct AnimationBase { uint8 animation_speed = spec->animation.speed; if (HasBit(spec->callback_mask, Tbase::cbm_animation_speed)) { uint16 callback = GetCallback(Tbase::cb_animation_speed, 0, 0, spec, obj, tile, extra_data); - if (callback != CALLBACK_FAILED) animation_speed = Clamp(callback & 0xFF, 0, 16); + if (callback != CALLBACK_FAILED) { + if (callback >= 0x100 && spec->grf_prop.grffile->grf_version >= 8) ErrorUnknownCallbackResult(spec->grf_prop.grffile->grfid, Tbase::cb_animation_speed, callback); + animation_speed = Clamp(callback & 0xFF, 0, 16); + } } /* An animation speed of 2 means the animation frame changes 4 ticks, and |