summaryrefslogtreecommitdiff
path: root/newgrf_engine.c
diff options
context:
space:
mode:
Diffstat (limited to 'newgrf_engine.c')
-rw-r--r--newgrf_engine.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/newgrf_engine.c b/newgrf_engine.c
index 679a88cbd..841cba1a9 100644
--- a/newgrf_engine.c
+++ b/newgrf_engine.c
@@ -102,6 +102,7 @@ static SpriteGroup *engine_custom_sprites[TOTAL_NUM_ENGINES][NUM_GLOBAL_CID];
void SetCustomEngineSprites(EngineID engine, byte cargo, SpriteGroup *group)
{
+ assert(engine < TOTAL_NUM_ENGINES);
if (engine_custom_sprites[engine][cargo] != NULL) {
DEBUG(grf, 6)("SetCustomEngineSprites: engine `%d' cargo `%d' already has group -- replacing.", engine, cargo);
}
@@ -610,6 +611,7 @@ StringID _engine_custom_names[TOTAL_NUM_ENGINES];
void SetCustomEngineName(EngineID engine, StringID name)
{
+ assert(engine < lengthof(_engine_custom_names));
_engine_custom_names[engine] = name;
}