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()); }