Found a bug

This commit is contained in:
2016-03-19 05:52:43 +11:00
parent 3a23ba93af
commit ff67b62792
2 changed files with 4 additions and 0 deletions
@@ -224,6 +224,7 @@ std::list<BoundingBox> World::GenerateCollisionGrid(Entity* ptr, int tileWidth,
wallBounds.y = snapToBase((double)wallBounds.h, ptr->GetOrigin().y);
while(wallBounds.y < (ptr->GetOrigin() + ptr->GetBounds()).y + ptr->GetBounds().h) {
//check to see if this tile is solid (non-existant tiles are always false)
if (regionPager.GetSolid(wallBounds.x / wallBounds.w, wallBounds.y / wallBounds.h)) {
//push onto the box set
boxList.push_front(wallBounds);
+3
View File
@@ -147,7 +147,10 @@ void World::Update() {
//get the collidable boxes
std::list<BoundingBox> boxList = GenerateCollisionGrid(localCharacter, tileSheet.GetTileW(), tileSheet.GetTileH());
std::cout << "Debug: " << boxList.size() << std::endl;
//process the collisions
//BUG: Collisions not working
if (localCharacter->ProcessCollisionGrid(boxList)) {
localCharacter->CorrectSprite();
SendLocalCharacterMovement();