Found a bug
This commit is contained in:
@@ -224,6 +224,7 @@ std::list<BoundingBox> World::GenerateCollisionGrid(Entity* ptr, int tileWidth,
|
|||||||
wallBounds.y = snapToBase((double)wallBounds.h, ptr->GetOrigin().y);
|
wallBounds.y = snapToBase((double)wallBounds.h, ptr->GetOrigin().y);
|
||||||
while(wallBounds.y < (ptr->GetOrigin() + ptr->GetBounds()).y + ptr->GetBounds().h) {
|
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)
|
//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)) {
|
if (regionPager.GetSolid(wallBounds.x / wallBounds.w, wallBounds.y / wallBounds.h)) {
|
||||||
//push onto the box set
|
//push onto the box set
|
||||||
boxList.push_front(wallBounds);
|
boxList.push_front(wallBounds);
|
||||||
|
|||||||
@@ -147,7 +147,10 @@ void World::Update() {
|
|||||||
//get the collidable boxes
|
//get the collidable boxes
|
||||||
std::list<BoundingBox> boxList = GenerateCollisionGrid(localCharacter, tileSheet.GetTileW(), tileSheet.GetTileH());
|
std::list<BoundingBox> boxList = GenerateCollisionGrid(localCharacter, tileSheet.GetTileW(), tileSheet.GetTileH());
|
||||||
|
|
||||||
|
std::cout << "Debug: " << boxList.size() << std::endl;
|
||||||
|
|
||||||
//process the collisions
|
//process the collisions
|
||||||
|
//BUG: Collisions not working
|
||||||
if (localCharacter->ProcessCollisionGrid(boxList)) {
|
if (localCharacter->ProcessCollisionGrid(boxList)) {
|
||||||
localCharacter->CorrectSprite();
|
localCharacter->CorrectSprite();
|
||||||
SendLocalCharacterMovement();
|
SendLocalCharacterMovement();
|
||||||
|
|||||||
Reference in New Issue
Block a user