diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2021-06-27 05:46:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-27 05:46:22 +0200 |
commit | dd1323d398733f0f4a3b285b396ed3a47fb8eb96 (patch) | |
tree | 3064b292efd41a36b5655fd4d07ec42053463ffb /src/World.cpp | |
parent | Merge pull request #60 from LaG1924/fix/memleak (diff) | |
parent | Fixed entity bug found by @uis246 (diff) | |
download | AltCraft-dd1323d398733f0f4a3b285b396ed3a47fb8eb96.tar AltCraft-dd1323d398733f0f4a3b285b396ed3a47fb8eb96.tar.gz AltCraft-dd1323d398733f0f4a3b285b396ed3a47fb8eb96.tar.bz2 AltCraft-dd1323d398733f0f4a3b285b396ed3a47fb8eb96.tar.lz AltCraft-dd1323d398733f0f4a3b285b396ed3a47fb8eb96.tar.xz AltCraft-dd1323d398733f0f4a3b285b396ed3a47fb8eb96.tar.zst AltCraft-dd1323d398733f0f4a3b285b396ed3a47fb8eb96.zip |
Diffstat (limited to 'src/World.cpp')
-rw-r--r-- | src/World.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/World.cpp b/src/World.cpp index e5e3fe8..6fcbdcd 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -114,7 +114,7 @@ bool World::isPlayerCollides(double X, double Y, double Z) const { for (int y = 0; y < 16; y++) { for (int z = 0; z < 16; z++) { BlockId block = section.GetBlockId(Vector(x, y, z)); - if (!GetBlockInfo(block).collides) + if (!GetBlockInfo(block)->collides) continue; AABB blockColl{ (x + it.x * 16.0), (y + it.y * 16.0), @@ -198,8 +198,8 @@ void World::UpdatePhysics(float delta) { for (int z = blockZBegin; z <= blockZEnd; z++) { for (int x = blockXBegin; x <= blockXEnd; x++) { OPTICK_EVENT("testCollision"); - BlockId block = this->GetBlockId(Vector(x, y, z)); - if (block.id == 0 || !GetBlockInfo(block).collides) + BlockId block = this->GetBlockId(Vector(x, y, z)); + if (block.id == 0 || !GetBlockInfo(block)->collides) continue; AABB blockColl{ (double)x,(double)y,(double)z,1.0,1.0,1.0 }; if (TestCollision(entityCollBox, blockColl)) { |