From 46c1c1476b65e46d7b09eb02a9a09f2041eb196c Mon Sep 17 00:00:00 2001 From: RektInator Date: Wed, 30 Oct 2019 12:48:32 +0100 Subject: [PATCH] techset fixes for iw3 --- src/IW3/Assets/Material.cpp | 7 +++++-- src/IW3/Assets/Techset.cpp | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/IW3/Assets/Material.cpp b/src/IW3/Assets/Material.cpp index ec2074e..0a8cc4d 100644 --- a/src/IW3/Assets/Material.cpp +++ b/src/IW3/Assets/Material.cpp @@ -99,7 +99,11 @@ namespace ZoneTool } auto file = FileSystem::FileOpen(path, "wb"); - + if (!file) + { + return; + } + nlohmann::json matdata; MATERIAL_DUMP_STRING(name); @@ -120,7 +124,6 @@ namespace ZoneTool MATERIAL_DUMP_INT(stateFlags); MATERIAL_DUMP_INT(cameraRegion); - MATERIAL_DUMP_BITS_ENTRY(stateBitsEntry, 34); MATERIAL_DUMP_CONST_ARRAY(constantTable, mat->constantCount); MATERIAL_DUMP_STATE_MAP(stateMap, mat->stateBitsCount); diff --git a/src/IW3/Assets/Techset.cpp b/src/IW3/Assets/Techset.cpp index 6b4876e..d463dbf 100644 --- a/src/IW3/Assets/Techset.cpp +++ b/src/IW3/Assets/Techset.cpp @@ -96,7 +96,7 @@ namespace ZoneTool // convert to IW4 auto asset = new IW4::VertexDecl; memset(asset, 0, sizeof IW4::VertexDecl); - + asset->name = name; asset->hasOptionalSource = vertex->hasOptionalSource;