From 65236bacc78b68b4ee6c0de853aeaad047bedf76 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Mon, 13 Jun 2022 01:07:16 +0100 Subject: [PATCH] Debug: Fix crash when dumping null sprite group --- src/newgrf_spritegroup.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/newgrf_spritegroup.cpp b/src/newgrf_spritegroup.cpp index a16dbacf37..7eea531ce3 100644 --- a/src/newgrf_spritegroup.cpp +++ b/src/newgrf_spritegroup.cpp @@ -773,8 +773,6 @@ bool SpriteGroupDumper::use_shadows = false; void SpriteGroupDumper::DumpSpriteGroup(const SpriteGroup *sg, int padding, uint flags) { - if (sg->nfo_line != 0) this->print_fn(sg, DSGPO_NFO_LINE, sg->nfo_line, nullptr); - uint32 highlight_tag = 0; auto print = [&]() { this->print_fn(sg, DSGPO_PRINT, highlight_tag, this->buffer); @@ -787,6 +785,8 @@ void SpriteGroupDumper::DumpSpriteGroup(const SpriteGroup *sg, int padding, uint return; } + if (sg->nfo_line != 0) this->print_fn(sg, DSGPO_NFO_LINE, sg->nfo_line, nullptr); + bool start_emitted = false; auto emit_start = [&]() { this->print_fn(sg, DSGPO_START, 0, nullptr);