Fix formatting and add an INBOUNDS_VEC

If `setactivitytext` was the last line in a script,
the command would index the vector out of bounds.

I also modified the formatting to keep consistent
with the rest of the codebase.
This commit is contained in:
AllyTally
2021-04-22 22:33:03 -03:00
committed by Misa Elizabeth Kai
parent b15e25f106
commit 656941202a
2 changed files with 8 additions and 3 deletions

View File

@@ -1909,8 +1909,11 @@ void scriptclass::run(void)
}
else if (words[0] == "setactivitytext")
{
position++;
obj.customactivitytext = commands[position];
++position;
if (INBOUNDS_VEC(position, commands))
{
obj.customactivitytext = commands[position];
}
}
else if (words[0] == "createrescuedcrew")
{