Apparently it was the #45 fix that broke collisions

This commit is contained in:
2016-03-22 00:47:38 +11:00
parent 30aa11c083
commit 12f86f22de
6 changed files with 21 additions and 12 deletions
+1 -1
View File
@@ -62,7 +62,7 @@ bool Region::SetSolid(int x, int y, bool b) {
return solid[x * REGION_WIDTH + y] = b;
}
bool Region::GetSolid(int x, int y) {
bool Region::GetSolid(int x, int y) const {
if (x < 0 || y < 0 || x >= REGION_WIDTH || y >= REGION_HEIGHT) {
throw(std::out_of_range("Region::GetSolid() argument out of range"));
}
+1 -1
View File
@@ -44,7 +44,7 @@ public:
type_t GetTile(int x, int y, int z);
bool SetSolid(int x, int y, bool b);
bool GetSolid(int x, int y);
bool GetSolid(int x, int y) const;
//accessors
int GetX() const;
+2 -8
View File
@@ -34,10 +34,7 @@ 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 = FindRegion(x, y);
if (!ptr) {
return 0;
}
Region* ptr = GetRegion(x, y);
return ptr->GetTile(x - ptr->GetX(), y - ptr->GetY(), z);
}
@@ -47,10 +44,7 @@ bool RegionPagerBase::SetSolid(int x, int y, int b) {
}
bool RegionPagerBase::GetSolid(int x, int y) {
Region* ptr = FindRegion(x, y);
if (!ptr) {
return 0;
}
Region* ptr = GetRegion(x, y);
return ptr->GetSolid(x - ptr->GetX(), y - ptr->GetY());
}
+1
View File
@@ -40,6 +40,7 @@ public:
virtual bool GetSolid(int x, int y);
//region manipulation
__attribute__ ((deprecated))
virtual Region* GetRegion(int x, int y);
virtual Region* FindRegion(int x, int y);
virtual Region* PushRegion(Region* const);