From 6e0119d753c1c0527d1a18ad2d0e1fdacca47157 Mon Sep 17 00:00:00 2001 From: Misa Date: Thu, 11 Jun 2020 17:37:46 -0700 Subject: [PATCH] Invert contents check in scriptclass::loadcustom() The entirety of the rest of scriptclass::loadcustom() is encased in a block that first checks if the script with the name even exists. Instead of indenting the rest of the function, just invert the check and reduce indentation level. --- desktop_version/src/Script.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/desktop_version/src/Script.cpp b/desktop_version/src/Script.cpp index 7f3777be..466fa14d 100644 --- a/desktop_version/src/Script.cpp +++ b/desktop_version/src/Script.cpp @@ -3564,7 +3564,10 @@ void scriptclass::loadcustom(std::string t) break; } } - if(contents != NULL){ + if(contents == NULL){ + return; + } + std::vector& lines = *contents; //Ok, we've got the relavent script segment, we do a pass to assess it, then run it! @@ -3824,5 +3827,4 @@ void scriptclass::loadcustom(std::string t) add("endcutscene()"); add("untilbars()"); } - } }