summaryrefslogtreecommitdiffstats
path: root/src/World.cpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2019-05-19 20:03:48 +0200
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2019-05-19 20:03:48 +0200
commit646f77ec6bc27af231b6ff8974e631b86188beb6 (patch)
treeea48447a4bdc947e67bbd900fd5716d48755619c /src/World.cpp
parentImplemented lua's "require" for AM (diff)
downloadAltCraft-646f77ec6bc27af231b6ff8974e631b86188beb6.tar
AltCraft-646f77ec6bc27af231b6ff8974e631b86188beb6.tar.gz
AltCraft-646f77ec6bc27af231b6ff8974e631b86188beb6.tar.bz2
AltCraft-646f77ec6bc27af231b6ff8974e631b86188beb6.tar.lz
AltCraft-646f77ec6bc27af231b6ff8974e631b86188beb6.tar.xz
AltCraft-646f77ec6bc27af231b6ff8974e631b86188beb6.tar.zst
AltCraft-646f77ec6bc27af231b6ff8974e631b86188beb6.zip
Diffstat (limited to 'src/World.cpp')
-rw-r--r--src/World.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/World.cpp b/src/World.cpp
index fa281f1..00a1a19 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -98,7 +98,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 (block.id == 0 || block.id == 31 || block.id == 37 || block.id == 38 || block.id == 175)
+ if (!GetBlockInfo(block).collides)
continue;
AABB blockColl{ (x + it.x * 16.0),
(y + it.y * 16.0),
@@ -183,8 +183,8 @@ void World::UpdatePhysics(float delta) {
for (int x = blockXBegin; x <= blockXEnd; x++) {
OPTICK_EVENT("testCollision");
BlockId block = this->GetBlockId(Vector(x, y, z));
- if (block.id == 0 || block.id == 31 || block.id == 37 || block.id == 38 || block.id == 175 || block.id == 78)
- continue;
+ if (block.id == 0 || !GetBlockInfo(block).collides)
+ continue;
AABB blockColl{ x,y,z,1.0,1.0,1.0 };
if (TestCollision(entityCollBox, blockColl)) {
return { true };