mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-22 05:27:19 +00:00
fix: respawn rotation (#1323)
* fixed respawn rotation * even though the condensed calls work, splitting em
This commit is contained in:
parent
a1f8ab763d
commit
3df3552467
@ -944,14 +944,7 @@ void GameMessages::SendResurrect(Entity* entity) {
|
|||||||
destroyableComponent->SetImagination(imaginationToRestore);
|
destroyableComponent->SetImagination(imaginationToRestore);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
auto cont = static_cast<ControllablePhysicsComponent*>(entity->GetComponent(eReplicaComponentType::CONTROLLABLE_PHYSICS));
|
|
||||||
if (cont && entity->GetLOT() == 1) {
|
|
||||||
cont->SetPosition(entity->GetRespawnPosition());
|
|
||||||
cont->SetRotation(entity->GetRespawnRotation());
|
|
||||||
}
|
|
||||||
|
|
||||||
CBITSTREAM;
|
CBITSTREAM;
|
||||||
CMSGHEADER;
|
CMSGHEADER;
|
||||||
@ -1144,18 +1137,16 @@ void GameMessages::SendPlayerReachedRespawnCheckpoint(Entity* entity, const NiPo
|
|||||||
bitStream.Write(position.y);
|
bitStream.Write(position.y);
|
||||||
bitStream.Write(position.z);
|
bitStream.Write(position.z);
|
||||||
|
|
||||||
auto con = static_cast<ControllablePhysicsComponent*>(entity->GetComponent(eReplicaComponentType::CONTROLLABLE_PHYSICS));
|
const bool isNotIdentity = rotation != NiQuaternion::IDENTITY;
|
||||||
if (con) {
|
bitStream.Write(isNotIdentity);
|
||||||
auto rot = con->GetRotation();
|
|
||||||
bitStream.Write(rot.x);
|
if (isNotIdentity) {
|
||||||
bitStream.Write(rot.y);
|
bitStream.Write(rotation.w);
|
||||||
bitStream.Write(rot.z);
|
bitStream.Write(rotation.x);
|
||||||
bitStream.Write(rot.w);
|
bitStream.Write(rotation.y);
|
||||||
|
bitStream.Write(rotation.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
//bitStream.Write(position);
|
|
||||||
//bitStream.Write(rotation);
|
|
||||||
|
|
||||||
SystemAddress sysAddr = entity->GetSystemAddress();
|
SystemAddress sysAddr = entity->GetSystemAddress();
|
||||||
SEND_PACKET;
|
SEND_PACKET;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user