aboutsummaryrefslogtreecommitdiff
path: root/src/server/luaentity_sao.h
diff options
context:
space:
mode:
authorhecks <42101236+hecktest@users.noreply.github.com>2021-01-02 15:14:29 +0100
committerGitHub <noreply@github.com>2021-01-02 15:14:29 +0100
commitdd5a732fa90550066bb96305b64b6648903cc822 (patch)
tree1d39d1362e7619ff459eb6da5f1c9aab7629d1b6 /src/server/luaentity_sao.h
parentad58fb22064c7db223cb825596c12f93f2a75a26 (diff)
downloadhax-minetest-server-dd5a732fa90550066bb96305b64b6648903cc822.tar.gz
hax-minetest-server-dd5a732fa90550066bb96305b64b6648903cc822.zip
Add on_deactivate callback for luaentities (#10723)
Diffstat (limited to 'src/server/luaentity_sao.h')
-rw-r--r--src/server/luaentity_sao.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/server/luaentity_sao.h b/src/server/luaentity_sao.h
index e060aa06d..6883ae1b9 100644
--- a/src/server/luaentity_sao.h
+++ b/src/server/luaentity_sao.h
@@ -71,6 +71,11 @@ public:
bool getSelectionBox(aabb3f *toset) const;
bool collideWithObjects() const;
+protected:
+ void dispatchScriptDeactivate();
+ virtual void onMarkedForDeactivation() { dispatchScriptDeactivate(); }
+ virtual void onMarkedForRemoval() { dispatchScriptDeactivate(); }
+
private:
std::string getPropertyPacket();
void sendPosition(bool do_interpolate, bool is_movement_end);