4 Commits

Author SHA1 Message Date
NyakoFox
cf66323721 Make sure special roomnames have enough text
There's another crash, which is indexing out of bounds if there's
not enough text. This adds simple bounds checks for them.
2026-02-16 11:43:24 -05:00
NyakoFox
b708b8911c Fix empty roomnames potentially crashing the game
TinyXML2 seems to sometimes return NULL when an element has either no
text or whitespace, instead of returning an empty string. Why it does
this, I'm not sure, but I have recently learned from Dav999 that it
will crash the game. Great.
2026-02-16 11:43:17 -05:00
leo60228
30bdb47f80 Don't overwrite existing CMAKE_EXE_LINKER_FLAGS 2026-01-24 18:57:31 -05:00
Ethan Lee
f22ae5fbf5 CMake: Use rpath, not runpath 2025-07-05 18:07:45 -04:00
3 changed files with 12 additions and 3 deletions

View File

@@ -54,6 +54,7 @@ if(NOT WIN32)
elseif(CMAKE_SIZEOF_VOID_P MATCHES "8")
set(BIN_LIBROOT "lib64")
set(BIN_RPATH "\$ORIGIN/lib64")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--disable-new-dtags")
else()
set(BIN_LIBROOT "lib")
set(BIN_RPATH "\$ORIGIN/lib")

View File

@@ -1387,6 +1387,10 @@ next:
{
name.text.push_back(std::string(text));
}
else
{
name.text.push_back(std::string(""));
}
}
else
{
@@ -1404,6 +1408,10 @@ next:
{
name.text.push_back(std::string(text));
}
else
{
name.text.push_back(std::string(""));
}
}
}
}

View File

@@ -214,11 +214,11 @@ void mapclass::updateroomnames(void)
if (rx == roomname->x && ry == roomname->y && (roomname->flag == -1 || (INBOUNDS_ARR(roomname->flag, obj.flags) && obj.flags[roomname->flag])))
{
roomname_special = true;
if (roomname->type == RoomnameType_STATIC)
if (roomname->type == RoomnameType_STATIC && roomname->text.size() >= 1)
{
setroomname(roomname->text[0].c_str());
}
if (roomname->type == RoomnameType_GLITCH)
if (roomname->type == RoomnameType_GLITCH && roomname->text.size() >= 2)
{
roomname->delay--;
if (roomname->delay <= 0)
@@ -232,7 +232,7 @@ void mapclass::updateroomnames(void)
}
setroomname(roomname->text[roomname->progress].c_str());
}
if (roomname->type == RoomnameType_TRANSFORM)
if (roomname->type == RoomnameType_TRANSFORM && roomname->text.size() >= 1)
{
roomname->delay--;
if (roomname->delay <= 0)