fix potential crash

This commit is contained in:
Tim Felgentreff 2022-05-19 17:10:22 +02:00
parent 77d7f1da6f
commit 07ea0ce1c7

View file

@ -480,6 +480,7 @@ void CViewport::Draw()
// If there was a click missile, draw it again here above the fog
if (clickMissile != NULL) {
Vec2i pos = Map.MapPixelPosToTilePos(clickMissile->position);
Map.Clamp(pos);
if (Map.Field(pos.x, pos.y)->playerInfo.TeamVisibilityState(*ThisPlayer) != 2) {
// if this tile is not visible, we want to draw the click on top of
// the fog again