Skip to content

Commit

Permalink
Merge pull request scp-fs2open#6097 from Goober5000/model_range_fix
Browse files Browse the repository at this point in the history
model range fix
  • Loading branch information
Goober5000 authored Apr 11, 2024
2 parents 71543c9 + 7fba753 commit e8d164c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/model/modelread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3842,7 +3842,7 @@ polymodel * model_get(int model_num)
Assertion( Polygon_models[num], "No model with id %d found. Please backtrace and investigate.\n", num );
Assertion( Polygon_models[num]->id == model_num, "Index collision between model %s and requested model %d. Please backtrace and investigate.\n", Polygon_models[num]->filename, model_num );

if (num < 0 || num > MAX_POLYGON_MODELS || !Polygon_models[num] || Polygon_models[num]->id != model_num)
if (num < 0 || num >= MAX_POLYGON_MODELS || !Polygon_models[num] || Polygon_models[num]->id != model_num)
return NULL;

return Polygon_models[num];
Expand Down

0 comments on commit e8d164c

Please sign in to comment.