From 60edaa7dcefaaa92777b05233ac35145ac18e585 Mon Sep 17 00:00:00 2001 From: Martin Fiedler Date: Thu, 2 Jul 2020 21:56:11 +0200 Subject: [PATCH] fix invalid polymodels if words_need_alignment=1 If compiled with words_need_alignment=1, the model data was correctly converted and expanded, but the old size was still used for validating and initializing the model. This caused funky effects on affected platforms, e.g. some robots missing their heads on Raspberry Pi. --- similar/main/polyobj.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/similar/main/polyobj.cpp b/similar/main/polyobj.cpp index e068ebafc..a9d9a28ce 100644 --- a/similar/main/polyobj.cpp +++ b/similar/main/polyobj.cpp @@ -766,9 +766,9 @@ void polygon_model_data_read(polymodel *pm, PHYSFS_File *fp) if (words_bigendian) swap_polygon_model_data(pm->model_data.get()); #if defined(DXX_BUILD_DESCENT_I) - g3_validate_polygon_model(pm->model_data.get(), model_data_size); + g3_validate_polygon_model(pm->model_data.get(), pm->model_data_size); #elif defined(DXX_BUILD_DESCENT_II) - g3_init_polygon_model(pm->model_data.get(), model_data_size); + g3_init_polygon_model(pm->model_data.get(), pm->model_data_size); #endif } }