From 8d0a90a5882fd7765ae8a6841475a64f24319385 Mon Sep 17 00:00:00 2001 From: Misa Date: Sun, 12 Sep 2021 21:54:47 -0700 Subject: [PATCH] Avoid function call to check empty room name Instead, a simple comparison of the first element will do. --- desktop_version/src/Game.cpp | 2 +- desktop_version/src/Render.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index 75b31dc1..d3a59d25 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -3958,7 +3958,7 @@ void Game::gethardestroom(void) if (roomx == 50 && roomy == 53) hardestroom =map.specialnames[6]; if (roomx == 50 && roomy == 54) hardestroom = map.specialnames[7]; } - else if (SDL_strcmp(map.roomname, "") == 0) + else if (map.roomname[0] == '\0') { hardestroom = map.hiddenname; } diff --git a/desktop_version/src/Render.cpp b/desktop_version/src/Render.cpp index 32a7737f..41e884a4 100644 --- a/desktop_version/src/Render.cpp +++ b/desktop_version/src/Render.cpp @@ -1737,7 +1737,7 @@ void gamerender(void) graphics.bprint(46, 6, game.timestring(), 196, 196, 196); } - if(map.extrarow==0 || (map.custommode && SDL_strcmp(map.roomname, "") != 0)) + if(map.extrarow==0 || (map.custommode && map.roomname[0] != '\0')) { graphics.footerrect.y = 230; if (graphics.translucentroomname) @@ -2013,7 +2013,7 @@ void maprender(void) //draw screen alliteration //Roomname: - if (SDL_strcmp(map.hiddenname, "") != 0) + if (map.hiddenname[0] != '\0') { graphics.Print(5, 2, map.hiddenname, 196, 196, 255 - help.glow, true); }