This commit is contained in:
Kayne Ruse
2015-04-26 03:29:33 +10:00
parent 0e149acc62
commit 2a1ee4acbf
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -85,7 +85,8 @@ void World::UpdateMap() {
//request empty regions within this zone //request empty regions within this zone
for (int i = xStart; i <= xEnd; i += REGION_WIDTH) { for (int i = xStart; i <= xEnd; i += REGION_WIDTH) {
for (int j = yStart; j <= yEnd; j += REGION_HEIGHT) { for (int j = yStart; j <= yEnd; j += REGION_HEIGHT) {
if (!regionPager.FindRegion(i, j)) { Region* region = regionPager.FindRegion(i, j);
if (!region || debugRegionSum(region) == 0) {
SendRegionRequest(roomIndex, i, j); SendRegionRequest(roomIndex, i, j);
} }
else { else {
+1 -1
View File
@@ -74,7 +74,7 @@ Region* RegionPagerBase::FindRegion(int x, int y) {
Region* RegionPagerBase::PushRegion(Region* const ptr) { Region* RegionPagerBase::PushRegion(Region* const ptr) {
//BUG: Lists seem to not work properly //BUG: Lists seem to not work properly
regionList.push_front(*ptr); regionList.push_front(*ptr);
if (debugRegionSum(&regionList.front())) { if (debugRegionSum(&regionList.front()) == 0) {
throw(std::runtime_error("Checksum fail; RegionPagerBase::PushRegion()")); throw(std::runtime_error("Checksum fail; RegionPagerBase::PushRegion()"));
} }
return &regionList.front(); return &regionList.front();