From 9591fca05134a7276fe1834f73c23f5a87134ea6 Mon Sep 17 00:00:00 2001 From: coco875 Date: Sun, 30 Nov 2025 22:42:54 +0100 Subject: remove assigment in if --- src/factories/DisplayListFactory.cpp | 38 ++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/src/factories/DisplayListFactory.cpp b/src/factories/DisplayListFactory.cpp index aa004ca..17f5f13 100644 --- a/src/factories/DisplayListFactory.cpp +++ b/src/factories/DisplayListFactory.cpp @@ -283,7 +283,8 @@ ExportResult DListBinaryExporter::Export(std::ostream &write, std::shared_ptr(overlap.value()); auto path = Companion::Instance->RelativePath(std::get<0>(overlap.value())); uint64_t hash = CRC64(path.c_str()); @@ -310,28 +311,31 @@ ExportResult DListBinaryExporter::Export(std::ostream &write, std::shared_ptr> 32; w1 = hash & 0xFFFFFFFF; - } else if(auto dec = Companion::Instance->GetSafeStringByAddr(ptr, "VTX"); dec.has_value()){ - uint64_t hash = CRC64(dec.value().c_str()); - if(hash == 0) { - throw std::runtime_error("Vtx hash is 0 for " + dec.value()); - } + } else { + auto dec = Companion::Instance->GetSafeStringByAddr(ptr, "VTX"); + if(dec.has_value()){ + uint64_t hash = CRC64(dec.value().c_str()); + if(hash == 0) { + throw std::runtime_error("Vtx hash is 0 for " + dec.value()); + } - SPDLOG_INFO("Found vtx: 0x{:X} Hash: 0x{:X} Path: {}", ptr, hash, dec.value()); + SPDLOG_INFO("Found vtx: 0x{:X} Hash: 0x{:X} Path: {}", ptr, hash, dec.value()); - N64Gfx value = gsSPVertexOTR(0, nvtx, didx); + N64Gfx value = gsSPVertexOTR(0, nvtx, didx); - SPDLOG_INFO("gsSPVertex({}, {}, 0x{:X})", nvtx, didx, ptr); + SPDLOG_INFO("gsSPVertex({}, {}, 0x{:X})", nvtx, didx, ptr); - w0 = value.words.w0; - w1 = value.words.w1; + w0 = value.words.w0; + w1 = value.words.w1; - writer.Write(w0); - writer.Write(w1); + writer.Write(w0); + writer.Write(w1); - w0 = hash >> 32; - w1 = hash & 0xFFFFFFFF; - } else { - SPDLOG_WARN("Could not find vtx at 0x{:X}", ptr); + w0 = hash >> 32; + w1 = hash & 0xFFFFFFFF; + } else { + SPDLOG_WARN("Could not find vtx at 0x{:X}", ptr); + } } } -- cgit v1.2.3