From ff67b6279296fe5a85699f62c6018b56b6332479 Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Sat, 19 Mar 2016 05:52:43 +1100 Subject: [PATCH] Found a bug --- client/gameplay_scenes/world_characters.cpp | 1 + client/gameplay_scenes/world_logic.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/client/gameplay_scenes/world_characters.cpp b/client/gameplay_scenes/world_characters.cpp index fc42df4..f46a108 100644 --- a/client/gameplay_scenes/world_characters.cpp +++ b/client/gameplay_scenes/world_characters.cpp @@ -224,6 +224,7 @@ std::list 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); diff --git a/client/gameplay_scenes/world_logic.cpp b/client/gameplay_scenes/world_logic.cpp index ffd0326..acc3111 100644 --- a/client/gameplay_scenes/world_logic.cpp +++ b/client/gameplay_scenes/world_logic.cpp @@ -147,7 +147,10 @@ void World::Update() { //get the collidable boxes std::list 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();