summaryrefslogtreecommitdiffstats
path: root/src/Entities/Entity.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Entities/Entity.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/Entities/Entity.h b/src/Entities/Entity.h
index 1384870b8..285ae8fac 100644
--- a/src/Entities/Entity.h
+++ b/src/Entities/Entity.h
@@ -452,11 +452,11 @@ public:
/** Gets entity (vehicle) attached to this entity */
cEntity * GetAttached();
- /** Attaches to the specified entity; detaches from any previous one first */
- virtual void AttachTo(cEntity * a_AttachTo);
+ /** Attaches to the specified entity; detaches from any previous one first. */
+ void AttachTo(cEntity & a_AttachTo);
- /** Detaches from the currently attached entity, if any */
- virtual void Detach(void);
+ /** Detaches from the currently attached entity, if any. */
+ void Detach(void);
/** Returns true if this entity is attached to the specified entity */
bool IsAttachedTo(const cEntity * a_Entity) const;
@@ -578,10 +578,10 @@ protected:
float m_Health;
float m_MaxHealth;
- /** The entity to which this entity is attached (vehicle), nullptr if none */
+ /** The entity to which this entity is attached (vehicle), nullptr if none. */
cEntity * m_AttachedTo;
- /** The entity which is attached to this entity (rider), nullptr if none */
+ /** The entity which is attached to this entity (rider), nullptr if none. */
cEntity * m_Attachee;
/** Stores whether head yaw has been set manually */
@@ -683,6 +683,9 @@ protected:
/** If has any mobs are leashed, broadcasts every leashed entity to this. */
void BroadcastLeashedMobs();
+ /** Called when this entity dismounts from m_AttachedTo. */
+ virtual void OnDetach();
+
private:
/** Whether the entity is ticking or not. If not, it is scheduled for removal or world-teleportation. */