diff options
author | paramat <paramat@users.noreply.github.com> | 2018-02-24 15:57:34 +0000 |
---|---|---|
committer | paramat <mat.gregory@virginmedia.com> | 2018-02-26 17:21:45 +0000 |
commit | 6c9df2ffa7ee81a05b28fdd6123a926abd284c72 (patch) | |
tree | 6740bb795dea4a7664da9f8db29fff41cd2e5239 /src | |
parent | 359a940dde0d0d85b288c8af6b10bccbd021f9c1 (diff) | |
download | minetest-6c9df2ffa7ee81a05b28fdd6123a926abd284c72.tar.gz minetest-6c9df2ffa7ee81a05b28fdd6123a926abd284c72.tar.bz2 minetest-6c9df2ffa7ee81a05b28fdd6123a926abd284c72.zip |
CollisionMoveSimple: Collide with 'ignore' nodes
Diffstat (limited to 'src')
-rw-r--r-- | src/collision.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/collision.cpp b/src/collision.cpp index 6edae1efc..24d22e825 100644 --- a/src/collision.cpp +++ b/src/collision.cpp @@ -279,7 +279,7 @@ collisionMoveResult collisionMoveSimple(Environment *env, IGameDef *gamedef, bool is_position_valid; MapNode n = map->getNodeNoEx(p, &is_position_valid); - if (is_position_valid) { + if (is_position_valid && n.getContent() != CONTENT_IGNORE) { // Object collides into walkable nodes any_position_valid = true; @@ -327,7 +327,8 @@ collisionMoveResult collisionMoveSimple(Environment *env, IGameDef *gamedef, cinfo.emplace_back(false, false, n_bouncy_value, p, box); } } else { - // Collide with unloaded nodes + // Collide with unloaded nodes (position invalid) and loaded + // CONTENT_IGNORE nodes (position valid) aabb3f box = getNodeBox(p, BS); cinfo.emplace_back(true, false, 0, p, box); } @@ -335,6 +336,8 @@ collisionMoveResult collisionMoveSimple(Environment *env, IGameDef *gamedef, // Do not move if world has not loaded yet, since custom node boxes // are not available for collision detection. + // This also intentionally occurs in the case of the object being positioned + // solely on loaded CONTENT_IGNORE nodes, no matter where they come from. if (!any_position_valid) { *speed_f = v3f(0, 0, 0); return result; |