Player class: disable copy
authorLoic Blot <loic.blot@unix-experience.fr>
Mon, 14 Aug 2017 08:52:59 +0000 (10:52 +0200)
committerLoic Blot <loic.blot@unix-experience.fr>
Mon, 14 Aug 2017 08:52:59 +0000 (10:52 +0200)
src/player.h

index fc799afb17fc21d696bfc66c637a2a5c895581a4..0b2cbbfb27eab0e369ce8fa6c91fab082702830e 100644 (file)
@@ -23,6 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "irrlichttypes_bloated.h"
 #include "inventory.h"
 #include "constants.h"
+#include "util/basic_macros.h"
 #include <list>
 #include <mutex>
 
@@ -88,9 +89,6 @@ struct CollisionInfo;
 struct HudElement;
 class Environment;
 
-// IMPORTANT:
-// Do *not* perform an assignment or copy operation on a Player or
-// RemotePlayer object!  This will copy the lock held for HUD synchronization
 class Player
 {
 public:
@@ -98,6 +96,8 @@ public:
        Player(const char *name, IItemDefManager *idef);
        virtual ~Player() = 0;
 
+       DISABLE_CLASS_COPY(Player);
+
        virtual void move(f32 dtime, Environment *env, f32 pos_max_d)
        {}
        virtual void move(f32 dtime, Environment *env, f32 pos_max_d,