From 7528ab19f0bf68dcbbb1bcb10e7511aa5e09cd88 Mon Sep 17 00:00:00 2001
From: jsalmon3 <>
Date: Sun, 29 Aug 2004 18:57:06 +0000
Subject: [PATCH] Fixed cache select optimization

---
 src/unit/unit_cache.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/unit/unit_cache.cpp b/src/unit/unit_cache.cpp
index 158d8be62..139b1e196 100644
--- a/src/unit/unit_cache.cpp
+++ b/src/unit/unit_cache.cpp
@@ -131,7 +131,7 @@ int UnitCacheSelect(int x1, int y1, int x2, int y2, Unit** table)
 	UnitListItem* listitem;
 
 	// Optimize small searches.
-	if (x1 == x2 && y1 == y2) {
+	if (x1 >= x2 - 1 && y1 >= y2 - 1) {
 		return UnitCacheOnTile(x1, y1, table);
 	}