summaryrefslogtreecommitdiffstats
path: root/src/World.cpp
diff options
context:
space:
mode:
authorUIS <uis9936@gmail.com>2020-08-14 00:38:23 +0200
committerLaG1924 <lag1924@gmail.com>2021-06-24 10:48:13 +0200
commite561e652ccae7d7fd214930000892cc24281f96c (patch)
tree4c06e3df8643fbbefe9c6d2a46b820dd8edaccf8 /src/World.cpp
parentMinor network fixes (diff)
downloadAltCraft-e561e652ccae7d7fd214930000892cc24281f96c.tar
AltCraft-e561e652ccae7d7fd214930000892cc24281f96c.tar.gz
AltCraft-e561e652ccae7d7fd214930000892cc24281f96c.tar.bz2
AltCraft-e561e652ccae7d7fd214930000892cc24281f96c.tar.lz
AltCraft-e561e652ccae7d7fd214930000892cc24281f96c.tar.xz
AltCraft-e561e652ccae7d7fd214930000892cc24281f96c.tar.zst
AltCraft-e561e652ccae7d7fd214930000892cc24281f96c.zip
Diffstat (limited to '')
-rw-r--r--src/World.cpp6
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)) {