From 559a5b39e320ee3f30b18955e6fbbd529fdcf946 Mon Sep 17 00:00:00 2001 From: fgenesis Date: Fri, 9 Dec 2022 04:21:46 +0100 Subject: [PATCH] Fix possible world map crash --- Aquaria/WorldMapRender.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Aquaria/WorldMapRender.cpp b/Aquaria/WorldMapRender.cpp index 0c065b6..4ba8110 100644 --- a/Aquaria/WorldMapRender.cpp +++ b/Aquaria/WorldMapRender.cpp @@ -1212,6 +1212,8 @@ Vector WorldMapRender::getAvatarWorldMapPosition() Vector WorldMapRender::getWorldToTile(WorldMapTile *tile, Vector position, bool fromCenter, bool tilePos) { + if(!tile->q) + return Vector(); const float sizew = (float)tile->q->texture->width; const float halfw = sizew / 2.0f; const float sizeh = (float)tile->q->texture->height; @@ -1412,7 +1414,7 @@ void WorldMapRender::toggle(bool turnON) //setVis(activeTile); // just set the color - if (activeTile) + if (activeTile && activeTile->q) { activeTile->q->color = Vector(1,1,1); activeTile->q->alphaMod = 1;