From cb640ffea4a51a10db2e379ada8dc0487378ba09 Mon Sep 17 00:00:00 2001 From: bibo38 Date: Wed, 12 Oct 2016 14:38:45 +0200 Subject: Spectators added (#2852) --- src/Entities/Pickup.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/Entities/Pickup.cpp') diff --git a/src/Entities/Pickup.cpp b/src/Entities/Pickup.cpp index 12d535f84..b1892e4cc 100644 --- a/src/Entities/Pickup.cpp +++ b/src/Entities/Pickup.cpp @@ -208,6 +208,12 @@ bool cPickup::CollectedBy(cPlayer & a_Dest) return false; // Not old enough } + // If the player is a spectator, he cannot collect anything + if (a_Dest.IsGameModeSpectator()) + { + return false; + } + if (cRoot::Get()->GetPluginManager()->CallHookCollectingPickup(a_Dest, *this)) { // LOG("Pickup %d cannot be collected by \"%s\", because a plugin has said no.", m_UniqueID, a_Dest->GetName().c_str()); -- cgit v1.2.3