From e2b3dc1c74ab74302513597b64f96185477ccb23 Mon Sep 17 00:00:00 2001 From: Marisa Kirisame Date: Tue, 15 May 2018 10:33:24 +0200 Subject: [PATCH] Remove unnecessary checks. (cherry picked from commit 98f279b6514061a9892b449f1f65fd209e01b45f) --- src/r_data/models/models.cpp | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/src/r_data/models/models.cpp b/src/r_data/models/models.cpp index fcfa9f38c..9efd5c6a7 100644 --- a/src/r_data/models/models.cpp +++ b/src/r_data/models/models.cpp @@ -416,7 +416,6 @@ static unsigned FindModel(const char * path, const char * modelfile) FMemLump lumpd = Wads.ReadLump(lump); char * buffer = (char*)lumpd.GetMem(); - bool isunreal3d = false; if ( fullname.IndexOf("_d.3d") == fullname.Len()-5 ) { FString anivfile = fullname.GetChars(); @@ -424,7 +423,6 @@ static unsigned FindModel(const char * path, const char * modelfile) if ( Wads.CheckNumForFullName(anivfile) > 0 ) { model = new FUE1Model; - isunreal3d = true; } } else if ( fullname.IndexOf("_a.3d") == fullname.Len()-5 ) @@ -434,23 +432,19 @@ static unsigned FindModel(const char * path, const char * modelfile) if ( Wads.CheckNumForFullName(datafile) > 0 ) { model = new FUE1Model; - isunreal3d = true; } } - if ( !isunreal3d ) + else if (!memcmp(buffer, "DMDM", 4)) { - if (!memcmp(buffer, "DMDM", 4)) - { - model = new FDMDModel; - } - else if (!memcmp(buffer, "IDP2", 4)) - { - model = new FMD2Model; - } - else if (!memcmp(buffer, "IDP3", 4)) - { - model = new FMD3Model; - } + model = new FDMDModel; + } + else if (!memcmp(buffer, "IDP2", 4)) + { + model = new FMD2Model; + } + else if (!memcmp(buffer, "IDP3", 4)) + { + model = new FMD3Model; } if (model != nullptr)