Apparently it was the #45 fix that broke collisions
This commit is contained in:
@@ -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"));
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user