mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-11-24 06:19:25 +03:00
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.
This commit is contained in:
1 parent
b708b8911c
commit
cf66323721
1 file changed
+3
-3
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user