1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-23 01:59:43 +01:00

Fix gray entities applying in main game

As reported by Lilithtreasure on the VVVVVV Discord server, it is
possible to get gray moving platforms and enemies in the main game.

This happens if you play the main game after loading a custom level with
a room that is gray at the same coordinates. E.g. if you play a custom
level with a gray room at (12, 4), then exit and go to Gantry and Dolly
in the main game which is also at (12, 4), then the platforms there
would be gray too.

This is because there is a missing map.custommode check.
This commit is contained in:
Misa 2023-03-28 20:56:03 -07:00
parent 09c07d8ad4
commit 98feeade02
2 changed files with 20 additions and 8 deletions

View file

@ -1286,13 +1286,19 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int
//Rule 4 is a horizontal line, 5 is vertical //Rule 4 is a horizontal line, 5 is vertical
//Rule 6 is a crew member //Rule 6 is a crew member
bool custom_gray;
#if !defined(NO_CUSTOM_LEVELS) #if !defined(NO_CUSTOM_LEVELS)
// Special case for gray Warp Zone tileset! // Special case for gray Warp Zone tileset!
const RoomProperty* const room = cl.getroomprop(game.roomx - 100, game.roomy - 100); if (map.custommode)
bool custom_gray = room->tileset == 3 && room->tilecol == 6; {
#else const RoomProperty* const room = cl.getroomprop(game.roomx - 100, game.roomy - 100);
bool custom_gray = false; custom_gray = room->tileset == 3 && room->tilecol == 6;
}
else
#endif #endif
{
custom_gray = false;
}
entclass& entity = *entptr; entclass& entity = *entptr;
entity.xp = xp; entity.xp = xp;

View file

@ -1913,13 +1913,19 @@ void Graphics::drawentity(const int i, const int yoff)
SDL_Rect drawRect; SDL_Rect drawRect;
bool custom_gray;
#if !defined(NO_CUSTOM_LEVELS) #if !defined(NO_CUSTOM_LEVELS)
// Special case for gray Warp Zone tileset! // Special case for gray Warp Zone tileset!
const RoomProperty* const room = cl.getroomprop(game.roomx - 100, game.roomy - 100); if (map.custommode)
const bool custom_gray = room->tileset == 3 && room->tilecol == 6; {
#else const RoomProperty* const room = cl.getroomprop(game.roomx - 100, game.roomy - 100);
const bool custom_gray = false; custom_gray = room->tileset == 3 && room->tilecol == 6;
}
else
#endif #endif
{
custom_gray = false;
}
SDL_Texture* sprites = flipmode ? grphx.im_flipsprites : grphx.im_sprites; SDL_Texture* sprites = flipmode ? grphx.im_flipsprites : grphx.im_sprites;
SDL_Texture* tiles = (map.custommode && !map.finalmode) ? grphx.im_entcolours : grphx.im_tiles; SDL_Texture* tiles = (map.custommode && !map.finalmode) ? grphx.im_entcolours : grphx.im_tiles;