mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Server-side authority for attached players (#10952)
The server must have authority about attachments. This commit ignores any player movement packets as long they're attached.
This commit is contained in:
parent
f018737b06
commit
7832b6843e
3 changed files with 15 additions and 35 deletions
|
@ -146,15 +146,11 @@ void LuaEntitySAO::step(float dtime, bool send_recommended)
|
|||
|
||||
// Each frame, parent position is copied if the object is attached, otherwise it's calculated normally
|
||||
// If the object gets detached this comes into effect automatically from the last known origin
|
||||
if(isAttached())
|
||||
{
|
||||
v3f pos = m_env->getActiveObject(m_attachment_parent_id)->getBasePosition();
|
||||
m_base_position = pos;
|
||||
if (auto *parent = getParent()) {
|
||||
m_base_position = parent->getBasePosition();
|
||||
m_velocity = v3f(0,0,0);
|
||||
m_acceleration = v3f(0,0,0);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
if(m_prop.physical){
|
||||
aabb3f box = m_prop.collisionbox;
|
||||
box.MinEdge *= BS;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue