1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-11-17 16:39:42 +01: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); gotoroom(rx, ry);
game.teleport = false; 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].xp = tx * 8;
obj.entities[t].yp = (ty * 8) - obj.entities[t].h; obj.entities[t].yp = (ty * 8) - obj.entities[t].h;