diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-12-01 23:33:48 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-12-01 23:33:48 +0200 |
commit | af322405454191846507b91251d655c2b0aa864b (patch) | |
tree | 06213c35a56ecbf3ad6e8b509052e1ccd23cb783 /src/serverobject.h | |
parent | ee0d3bacbce612c1abc6016cb7b0d684df25b820 (diff) | |
download | minetest-af322405454191846507b91251d655c2b0aa864b.tar.gz minetest-af322405454191846507b91251d655c2b0aa864b.tar.bz2 minetest-af322405454191846507b91251d655c2b0aa864b.zip |
Players are more like objects + related stuff
Diffstat (limited to 'src/serverobject.h')
-rw-r--r-- | src/serverobject.h | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/serverobject.h b/src/serverobject.h index 4dac46863..1386136ce 100644 --- a/src/serverobject.h +++ b/src/serverobject.h @@ -43,6 +43,7 @@ Some planning class ServerEnvironment; class InventoryItem; class Player; +struct ToolDiggingProperties; class ServerActiveObject : public ActiveObject { @@ -128,23 +129,24 @@ public: virtual bool isStaticAllowed() const {return true;} - virtual void punch(ServerActiveObject *puncher){} - virtual void rightClick(ServerActiveObject *clicker){} - - // Returns a reference - virtual InventoryItem* getWieldedItem() - { return NULL; } + // time_from_last_punch is used for lessening damage if punching fast + virtual void punch(ServerActiveObject *puncher, + float time_from_last_punch=1000000) + {} + virtual void rightClick(ServerActiveObject *clicker) + {} + virtual void getWieldDiggingProperties(ToolDiggingProperties *dst); virtual void damageWieldedItem(u16 amount) - {} + {} // If all fits, eats item and returns true. Otherwise returns false. virtual bool addToInventory(InventoryItem *item) - {return false;} + { return false; } virtual void addToInventoryLater(InventoryItem *item) - {} + {} virtual void setHP(s16 hp) - {} + {} virtual s16 getHP() - {return 0;} + { return 0; } /* Number of players which know about this object. Object won't be |