diff --git a/src/common/models/voxels.cpp b/src/common/models/voxels.cpp index b85f2f851..d8d2b2245 100644 --- a/src/common/models/voxels.cpp +++ b/src/common/models/voxels.cpp @@ -314,6 +314,7 @@ FVoxelDef *R_LoadVoxelDef(int lumpnum, int spin) else { FVoxelDef *voxdef = new FVoxelDef; + *voxdef = {}; voxdef->Voxel = vox; voxdef->Scale = 1.; voxdef->DroppedSpin = voxdef->PlacedSpin = spin; diff --git a/src/r_data/models.cpp b/src/r_data/models.cpp index 9c204df04..453d67180 100644 --- a/src/r_data/models.cpp +++ b/src/r_data/models.cpp @@ -425,9 +425,11 @@ void InitModels() smf.animationIDs[0] = -1; smf.xscale = smf.yscale = smf.zscale = VoxelDefs[i]->Scale; smf.angleoffset = VoxelDefs[i]->AngleOffset.Degrees(); - if (VoxelDefs[i]->PitchFromMomentum == true) smf.flags |= MDL_PITCHFROMMOMENTUM; - if (VoxelDefs[i]->UseActorPitch == true) smf.flags |= MDL_USEACTORPITCH; - if (VoxelDefs[i]->UseActorRoll == true) smf.flags |= MDL_USEACTORROLL; + // this helps catching uninitialized data. + assert(VoxelDefs[i]->PitchFromMomentum == true || VoxelDefs[i]->PitchFromMomentum == false); + if (VoxelDefs[i]->PitchFromMomentum) smf.flags |= MDL_PITCHFROMMOMENTUM; + if (VoxelDefs[i]->UseActorPitch) smf.flags |= MDL_USEACTORPITCH; + if (VoxelDefs[i]->UseActorRoll) smf.flags |= MDL_USEACTORROLL; if (VoxelDefs[i]->PlacedSpin != 0) { smf.yrotate = 1.f;