1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-11-18 02:16:23 -05:00

Fixed possible crash when placing tiles outside of map (#453)

This commit is contained in:
Tim Sarbin 2020-06-25 14:53:22 -04:00 committed by GitHub
parent 162252e82d
commit 6778658606
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -314,7 +314,7 @@ func areaEmpty(mapEngine *d2mapengine.MapEngine, rect d2common.Rectangle) bool {
mapHeight := mapEngine.Size().Height mapHeight := mapEngine.Size().Height
mapWidth := mapEngine.Size().Width 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 return false
} }