From 2a1ee4acbf52e94b5d15d0559b584fc992310f06 Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Sun, 26 Apr 2015 03:29:33 +1000 Subject: [PATCH] tmp --- client/gameplay_scenes/world_map.cpp | 3 ++- common/map/region_pager_base.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/client/gameplay_scenes/world_map.cpp b/client/gameplay_scenes/world_map.cpp index 8366704..f0ec79a 100644 --- a/client/gameplay_scenes/world_map.cpp +++ b/client/gameplay_scenes/world_map.cpp @@ -85,7 +85,8 @@ void World::UpdateMap() { //request empty regions within this zone for (int i = xStart; i <= xEnd; i += REGION_WIDTH) { 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); } else { diff --git a/common/map/region_pager_base.cpp b/common/map/region_pager_base.cpp index 44c595e..601f984 100644 --- a/common/map/region_pager_base.cpp +++ b/common/map/region_pager_base.cpp @@ -74,7 +74,7 @@ Region* RegionPagerBase::FindRegion(int x, int y) { Region* RegionPagerBase::PushRegion(Region* const ptr) { //BUG: Lists seem to not work properly regionList.push_front(*ptr); - if (debugRegionSum(®ionList.front())) { + if (debugRegionSum(®ionList.front()) == 0) { throw(std::runtime_error("Checksum fail; RegionPagerBase::PushRegion()")); } return ®ionList.front();