1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-25 22:18:30 +02:00

Use INBOUNDS() check for mapclass::warpto()

There's a lot of places where the INBOUNDS() check is spelled out
instead of using the macro, before the macro was introduced. Also the
macro should probably be renamed INBOUNDS_VEC() to be consistent.
This commit is contained in:
Misa 2020-07-21 14:49:36 -07:00 committed by Ethan Lee
parent fdb01adc68
commit ff8d616438

View File

@ -889,7 +889,7 @@ void mapclass::warpto(int rx, int ry , int t, int tx, int ty)
{
gotoroom(rx, ry);
game.teleport = false;
if (t >= 0 && t < (int) obj.entities.size())
if (INBOUNDS(t, obj.entities))
{
obj.entities[t].xp = tx * 8;
obj.entities[t].yp = (ty * 8) - obj.entities[t].h;