1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-12 16:15:20 +02:00

Add ServerActiveObject::removingFromEnvironment()

This commit is contained in:
Perttu Ahola
2011-12-01 13:22:33 +02:00
parent 0e113a4c81
commit e6e3eef0ef
3 changed files with 17 additions and 6 deletions

View File

@@ -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){}