diff options
| author | Jonas Ask | 2009-10-30 16:33:45 +0000 |
|---|---|---|
| committer | Jonas Ask | 2009-10-30 16:33:45 +0000 |
| commit | a17037974d9053650558f86d527720c9e843d283 (patch) | |
| tree | 89d2975db67b357324c93082f3c13d429cb717e8 /WorldSegment.cpp | |
| parent | 5b51a65b6c0cf97727ca91e7a62af6b8ea443ec6 (diff) | |
| download | stonesense-a17037974d9053650558f86d527720c9e843d283.tar.gz stonesense-a17037974d9053650558f86d527720c9e843d283.tar.bz2 stonesense-a17037974d9053650558f86d527720c9e843d283.tar.xz | |
Fixed an embarrassing bug in CoordinateInsideRegion function. It is now called CoordinateInsideSEGMENT and works as expected.
Diffstat (limited to 'WorldSegment.cpp')
| -rw-r--r-- | WorldSegment.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/WorldSegment.cpp b/WorldSegment.cpp index 7f49bee..6f6e460 100644 --- a/WorldSegment.cpp +++ b/WorldSegment.cpp @@ -77,9 +77,12 @@ void WorldSegment::drawAllBlocks(BITMAP* target){ }
-bool WorldSegment::CoordinateInsideRegion(uint32_t x, uint32_t y, uint32_t z){
- if( x < 0 || (int32_t)x >= this->regionSize.x) return false;
+bool WorldSegment::CoordinateInsideSegment(uint32_t x, uint32_t y, uint32_t z){
+ /*if( x < 0 || (int32_t)x >= this->regionSize.x) return false;
if( y < 0 || (int32_t)y >= this->regionSize.y) return false;
- if( z < 0 || (int32_t)z >= this->regionSize.z) return false;
+ if( z < 0 || (int32_t)z >= this->regionSize.z) return false;*/
+ if( x < this->x || (int32_t)x >= this->x + this->sizex) return false;
+ if( y < this->y || (int32_t)y >= this->y + this->sizey) return false;
+ if( z < this->z || (int32_t)z >= this->z + this->sizez) return false;
return true;
}
\ No newline at end of file |
