mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-22 17:49:43 +01:00
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:
parent
b15e25f106
commit
656941202a
2 changed files with 8 additions and 3 deletions
|
@ -1056,7 +1056,9 @@ void entityclass::createblock( int t, int xp, int yp, int w, int h, int trig /*=
|
|||
if (custom)
|
||||
{
|
||||
block.prompt = "Press %s to interact";
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
block.prompt = "Press %s to activate terminal";
|
||||
}
|
||||
block.script = "custom_"+customscript;
|
||||
|
|
|
@ -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")
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue