diff options
Diffstat (limited to 'src/serverobject.h')
-rw-r--r-- | src/serverobject.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/serverobject.h b/src/serverobject.h index 9e9513a7c..b901cbf4d 100644 --- a/src/serverobject.h +++ b/src/serverobject.h @@ -54,8 +54,10 @@ public: ServerActiveObject(ServerEnvironment *env, v3f pos); virtual ~ServerActiveObject(); - // Call after id has been set and has been inserted in environment - virtual void addedToEnvironment(); + // Called after id has been set and has been inserted in environment + virtual void addedToEnvironment(){}; + // Called before removing from environment + virtual void removingFromEnvironment(){}; // Create a certain type of ServerActiveObject static ServerActiveObject* create(u8 type, @@ -111,6 +113,11 @@ public: the data is the static form) */ virtual std::string getStaticData(){return "";} + /* + Return false in here to never save and instead remove object + on unload. getStaticData() will not be called in that case. + */ + virtual bool isStaticAllowed(){return true;} virtual void punch(ServerActiveObject *puncher){} virtual void rightClick(ServerActiveObject *clicker){} |