From 37fadc6567d4acfdc6e8bebbc8914f2cbcac98f9 Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Mon, 24 Aug 2015 14:26:32 +1000 Subject: [PATCH] Resolved bug #45 --- map/region_pager_base.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/map/region_pager_base.cpp b/map/region_pager_base.cpp index 857dabd..f041e89 100644 --- a/map/region_pager_base.cpp +++ b/map/region_pager_base.cpp @@ -34,7 +34,10 @@ Region::type_t RegionPagerBase::SetTile(int x, int y, int z, Region::type_t v) { } Region::type_t RegionPagerBase::GetTile(int x, int y, int z) { - Region* ptr = GetRegion(x, y); + Region* ptr = FindRegion(x, y); + if (!ptr) { + return 0; + } return ptr->GetTile(x - ptr->GetX(), y - ptr->GetY(), z); } @@ -44,7 +47,10 @@ bool RegionPagerBase::SetSolid(int x, int y, int b) { } bool RegionPagerBase::GetSolid(int x, int y) { - Region* ptr = GetRegion(x, y); + Region* ptr = FindRegion(x, y); + if (!ptr) { + return 0; + } return ptr->GetSolid(x - ptr->GetX(), y - ptr->GetY()); }