mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03:00
Don't manually write out INBOUNDS_ARR() checks
When this is done, there is potential for a mistake to occur when writing out the bounds check, which is eliminated when using the macro instead. Luckily, this doesn't seem to have happened, but what's even worse is I hardcoded 400 instead of using SDL_arraysize(ed.level), so if the size of ed.level the bounds checks would all be wrong, which wouldn't be good. But that's fixed now, too.
This commit is contained in:
@@ -1190,7 +1190,7 @@ void entityclass::createentity( float xp, float yp, int t, float vx /*= 0*/, flo
|
||||
#if !defined(NO_CUSTOM_LEVELS)
|
||||
// Special case for gray Warp Zone tileset!
|
||||
int room = game.roomx-100 + (game.roomy-100) * ed.maxwidth;
|
||||
bool custom_gray = room >= 0 && room < 400
|
||||
bool custom_gray = INBOUNDS_ARR(room, ed.level)
|
||||
&& ed.level[room].tileset == 3 && ed.level[room].tilecol == 6;
|
||||
#else
|
||||
bool custom_gray = false;
|
||||
|
||||
Reference in New Issue
Block a user