Skip to content

Commit

Permalink
Fix crash when a voxel has more sections than its HVA
Browse files Browse the repository at this point in the history
  • Loading branch information
Rampastring committed Jan 29, 2024
1 parent 46c5343 commit b0c98d9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/TSMapEditor/Rendering/ObjectRenderers/VxlRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ public class VxlRenderer

public static Texture2D Render(GraphicsDevice graphicsDevice, byte facing, RampType ramp, VxlFile vxl, HvaFile hva, Palette palette, VplFile vpl = null, bool forRemap = false)
{
if (vxl.Sections.Count > hva.Sections.Count)
return null;

/*********** Voxel space setup **********/

float rotationFromFacing = 2 * (float)Math.PI * ((float)facing / Constants.FacingMax);
Expand Down

0 comments on commit b0c98d9

Please sign in to comment.