mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
Handle SMSG_GAMEOBJECT_CUSTOM_ANIM to unfreeze gameobjects on use
When the server sends a custom animation packet (e.g. chest being opened), unfreeze the M2 instance so it plays its open animation.
This commit is contained in:
parent
58681753e5
commit
639df4815e
3 changed files with 26 additions and 0 deletions
|
|
@ -1548,6 +1548,18 @@ void Application::setupUICallbacks() {
|
|||
despawnOnlineGameObject(guid);
|
||||
});
|
||||
|
||||
// GameObject custom animation callback (e.g. chest opening)
|
||||
gameHandler->setGameObjectCustomAnimCallback([this](uint64_t guid, uint32_t /*animId*/) {
|
||||
auto it = gameObjectInstances_.find(guid);
|
||||
if (it == gameObjectInstances_.end() || !renderer) return;
|
||||
auto& info = it->second;
|
||||
if (!info.isWmo) {
|
||||
if (auto* m2r = renderer->getM2Renderer()) {
|
||||
m2r->setInstanceAnimationFrozen(info.instanceId, false);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Charge callback — warrior rushes toward target
|
||||
gameHandler->setChargeCallback([this](uint64_t targetGuid, float tx, float ty, float tz) {
|
||||
if (!renderer || !renderer->getCameraController() || !gameHandler) return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue