mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-06-28 15:50:02 +00:00
fix: multiplied speeds with Speed Behaviors (#1832)
This commit is contained in:
parent
1f580491c7
commit
ec9927acbb
@ -265,7 +265,7 @@ bool ModelComponent::TrySetVelocity(const NiPoint3& velocity) const {
|
|||||||
|
|
||||||
// If we're currently moving on an axis, prevent the move so only 1 behavior can have control over an axis
|
// If we're currently moving on an axis, prevent the move so only 1 behavior can have control over an axis
|
||||||
if (velocity != NiPoint3Constant::ZERO) {
|
if (velocity != NiPoint3Constant::ZERO) {
|
||||||
const auto [x, y, z] = velocity;
|
const auto [x, y, z] = velocity * m_Speed;
|
||||||
if (x != 0.0f) {
|
if (x != 0.0f) {
|
||||||
if (currentVelocity.x != 0.0f) return false;
|
if (currentVelocity.x != 0.0f) return false;
|
||||||
currentVelocity.x = x;
|
currentVelocity.x = x;
|
||||||
@ -280,7 +280,6 @@ bool ModelComponent::TrySetVelocity(const NiPoint3& velocity) const {
|
|||||||
currentVelocity = velocity;
|
currentVelocity = velocity;
|
||||||
}
|
}
|
||||||
|
|
||||||
currentVelocity *= m_Speed;
|
|
||||||
m_Parent->SetVelocity(currentVelocity);
|
m_Parent->SetVelocity(currentVelocity);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user