map: can't get negative value

Signed-off-by: matthias <uso.cosmo.ray@gmail.com>
This commit is contained in:
Matthias Gatto 2021-05-21 04:44:29 +02:00
parent bd40f7e553
commit 3f8e30b184
2 changed files with 4 additions and 1 deletions

View File

@ -362,6 +362,9 @@ Entity *ywMapCaseXY(Entity *state, int x, int y)
int w = yeGetInt(yeGet(state, "width"));
Entity *ret;
if (x < 0 || y < 0) {
return NULL;
}
ret = yeGet(map, x + (w * y));
if (unlikely(!ret)) {
int iPos = x + (w * y);

@ -1 +1 @@
Subproject commit 47a3e2b2a9326c33ad6f177794705987399de8cf
Subproject commit c2ce97f031cdb2b9188fb5a7264b9b5de209bea2