Skip to content

Commit 7bd02a5

Browse files
committed
fix: beast form transform animation bug
tiltedphoques#831
1 parent a6f29e9 commit 7bd02a5

File tree

5 files changed

+23
-0
lines changed

5 files changed

+23
-0
lines changed

Code/server/Game/Animation/ActionReplayCache.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,8 @@ std::optional<std::string_view> ActionReplayCache::FindInstantCounterpartForActi
9494
}
9595
return std::nullopt;
9696
}
97+
98+
void ActionReplayCache::Clear() noexcept
99+
{
100+
m_actions.clear();
101+
}

Code/server/Game/Animation/ActionReplayCache.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ class ActionReplayCache
2525

2626
const Vector<ActionEvent>& GetActions() const noexcept { return m_actions; };
2727

28+
void Clear() noexcept;
29+
2830
private:
2931
// Returns true if clients should reset the animation graph of the Actor before replaying
3032
bool RefineReplayCache() noexcept;

Code/server/Game/Animation/AnimationEventLists.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ const Set<std::string_view> AnimationEventLists::kIgnore = {
177177
{"idleChairVar2"},
178178
{"idleChairArmsCrossedVar1"},
179179
{"idleChairArmsCrossedVar2"},
180+
// See `Actor::FixVampireLordModel`
181+
{"LevitationToggle"},
180182
// Weapon drawing is handled separately in CharacterService
181183
{"WeapEquip"},
182184
{"WeapSoloEquip"},

Code/server/Services/CharacterService.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,13 @@ void CharacterService::OnRequestRespawn(const PacketEvent<RequestRespawn>& acMes
549549

550550
const auto resolvedEntity = *it;
551551
auto& ownerComponent = view.get<OwnerComponent>(*it);
552+
if (auto* pAnimationComponent = m_world.try_get<AnimationComponent>(resolvedEntity))
553+
{
554+
pAnimationComponent->Actions.clear();
555+
pAnimationComponent->CurrentAction = {};
556+
pAnimationComponent->ActionsReplayCache.Clear();
557+
}
558+
552559
if (ownerComponent.GetOwner() == acMessage.pPlayer)
553560
{
554561
if (!acMessage.Packet.AppearanceBuffer.empty())

Code/server/Services/PlayerService.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,13 @@ void PlayerService::OnPlayerRespawnRequest(const PacketEvent<PlayerRespawnReques
173173
return;
174174
}
175175

176+
if (auto* pAnimationComponent = m_world.try_get<AnimationComponent>(*entity))
177+
{
178+
pAnimationComponent->Actions.clear();
179+
pAnimationComponent->CurrentAction = {};
180+
pAnimationComponent->ActionsReplayCache.Clear();
181+
}
182+
176183
auto view = m_world.view<InventoryComponent>();
177184

178185
const auto it = view.find(*entity);

0 commit comments

Comments
 (0)