town_cmd.c
changeset 4357 3d72606e9192
parent 4355 4a9362d78854
child 4384 293c0d26294c
--- a/town_cmd.c	Tue Aug 22 21:14:45 2006 +0000
+++ b/town_cmd.c	Tue Aug 22 21:17:19 2006 +0000
@@ -952,8 +952,7 @@
 		if (!IsValidTown(t)) {
 			TownID index = t->index;
 
-			if (t->index > _total_towns)
-				_total_towns = t->index;
+			if (t->index >= _total_towns) _total_towns = t->index + 1;
 
 			memset(t, 0, sizeof(Town));
 			t->index = index;
@@ -1956,8 +1955,7 @@
 		t = GetTown(index);
 		SlObject(t, _town_desc);
 
-		if ((uint)index > _total_towns)
-			_total_towns = index;
+		if ((uint)index >= _total_towns) _total_towns = index + 1;
 	}
 
 	/* This is to ensure all pointers are within the limits of