summaryrefslogtreecommitdiffstats
path: root/src/Entities/Minecart.cpp
diff options
context:
space:
mode:
authorbibo38 <bibo38@users.noreply.github.com>2016-10-12 14:38:45 +0200
committerMattes D <github@xoft.cz>2016-10-12 14:38:45 +0200
commitcb640ffea4a51a10db2e379ada8dc0487378ba09 (patch)
tree780ff243f439c9663b2f88e5df2805cc503f4f1d /src/Entities/Minecart.cpp
parentFixed cProjectileEntity double destroy bug (#3397) (diff)
downloadcuberite-cb640ffea4a51a10db2e379ada8dc0487378ba09.tar
cuberite-cb640ffea4a51a10db2e379ada8dc0487378ba09.tar.gz
cuberite-cb640ffea4a51a10db2e379ada8dc0487378ba09.tar.bz2
cuberite-cb640ffea4a51a10db2e379ada8dc0487378ba09.tar.lz
cuberite-cb640ffea4a51a10db2e379ada8dc0487378ba09.tar.xz
cuberite-cb640ffea4a51a10db2e379ada8dc0487378ba09.tar.zst
cuberite-cb640ffea4a51a10db2e379ada8dc0487378ba09.zip
Diffstat (limited to 'src/Entities/Minecart.cpp')
-rw-r--r--src/Entities/Minecart.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/Entities/Minecart.cpp b/src/Entities/Minecart.cpp
index 43291bdc8..88b5959d5 100644
--- a/src/Entities/Minecart.cpp
+++ b/src/Entities/Minecart.cpp
@@ -39,7 +39,15 @@ public:
{
ASSERT(a_Entity != nullptr);
- if (!a_Entity->IsPlayer() && !a_Entity->IsMob() && !a_Entity->IsMinecart() && !a_Entity->IsBoat())
+ if (
+ (
+ !a_Entity->IsPlayer() ||
+ reinterpret_cast<cPlayer *>(a_Entity)->IsGameModeSpectator() // Spectators doesn't collide with anything
+ ) &&
+ !a_Entity->IsMob() &&
+ !a_Entity->IsMinecart() &&
+ !a_Entity->IsBoat()
+ )
{
return false;
}