mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-12 16:58:39 +00: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:
parent
88efebdf86
commit
ee63b94f2c
6 changed files with 28 additions and 14 deletions
|
@ -118,15 +118,14 @@ UnitSAO::UnitSAO(ServerEnvironment *env, v3f pos):
|
|||
m_armor_groups["fleshy"] = 100;
|
||||
}
|
||||
|
||||
bool UnitSAO::isAttached() const
|
||||
ServerActiveObject *UnitSAO::getParent() const
|
||||
{
|
||||
if (!m_attachment_parent_id)
|
||||
return false;
|
||||
return nullptr;
|
||||
// Check if the parent still exists
|
||||
ServerActiveObject *obj = m_env->getActiveObject(m_attachment_parent_id);
|
||||
if (obj)
|
||||
return true;
|
||||
return false;
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
void UnitSAO::setArmorGroups(const ItemGroupList &armor_groups)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue