1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-29 22:55:19 +01:00

Prevent objects from colliding with own child attachments (#7610)

Also, use a better distance calculation for 'collide with objects'.
Fixes the issue of a vehicle occasionally colliding with its own driver,
causing one of the velocity components to be set to zero.
This commit is contained in:
SmallJoker
2018-08-05 22:28:41 +02:00
committed by Paramat
parent 88efebdf86
commit ee63b94f2c
6 changed files with 28 additions and 14 deletions

View File

@@ -42,7 +42,9 @@ public:
// Use a function, if isDead can be defined by other conditions
bool isDead() const { return m_hp == 0; }
bool isAttached() const;
inline bool isAttached() const
{ return getParent(); }
void setArmorGroups(const ItemGroupList &armor_groups);
const ItemGroupList &getArmorGroups();
void setAnimation(v2f frame_range, float frame_speed, float frame_blend, bool frame_loop);
@@ -57,6 +59,7 @@ public:
void addAttachmentChild(int child_id);
void removeAttachmentChild(int child_id);
const std::unordered_set<int> &getAttachmentChildIds();
ServerActiveObject *getParent() const;
ObjectProperties* accessObjectProperties();
void notifyObjectPropertiesModified();
protected: