From 677865860665b1eddc843271d5995e80d0dd5a78 Mon Sep 17 00:00:00 2001 From: Tim Sarbin Date: Thu, 25 Jun 2020 14:53:22 -0400 Subject: [PATCH] Fixed possible crash when placing tiles outside of map (#453) --- d2core/d2map/d2mapgen/act1_overworld.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/d2core/d2map/d2mapgen/act1_overworld.go b/d2core/d2map/d2mapgen/act1_overworld.go index 42c04833..fd215af6 100644 --- a/d2core/d2map/d2mapgen/act1_overworld.go +++ b/d2core/d2map/d2mapgen/act1_overworld.go @@ -314,7 +314,7 @@ func areaEmpty(mapEngine *d2mapengine.MapEngine, rect d2common.Rectangle) bool { mapHeight := mapEngine.Size().Height mapWidth := mapEngine.Size().Width - if rect.Bottom() >= mapHeight || rect.Right() >= mapWidth { + if rect.Top < 0 || rect.Left < 0 || rect.Bottom() >= mapHeight || rect.Right() >= mapWidth { return false }