Fix asynchronous actions executing other strips actions

This commit is contained in:
David Markowitz 2025-04-02 23:52:56 -07:00
parent 51e4273a53
commit a909546e2f
2 changed files with 7 additions and 3 deletions
dGame
dComponents
dPropertyBehaviors

@ -10,7 +10,6 @@
#include "SimplePhysicsComponent.h" #include "SimplePhysicsComponent.h"
#include "Database.h" #include "Database.h"
#include "EntityInfo.h"
ModelComponent::ModelComponent(Entity* parent) : Component(parent) { ModelComponent::ModelComponent(Entity* parent) : Component(parent) {
m_OriginalPosition = m_Parent->GetDefaultPosition(); m_OriginalPosition = m_Parent->GetDefaultPosition();
@ -30,6 +29,9 @@ bool ModelComponent::OnResetModelToDefaults(GameMessages::GameMsg& msg) {
unsmash.target = GetParent()->GetObjectID(); unsmash.target = GetParent()->GetObjectID();
unsmash.duration = 0.0f; unsmash.duration = 0.0f;
unsmash.Send(UNASSIGNED_SYSTEM_ADDRESS); unsmash.Send(UNASSIGNED_SYSTEM_ADDRESS);
m_NumListeningInteract = 0;
m_Dirty = true;
Game::entityManager->SerializeEntity(GetParent());
return true; return true;
} }
@ -171,14 +173,14 @@ std::array<std::pair<int32_t, std::string>, 5> ModelComponent::GetBehaviorsForSa
} }
void ModelComponent::AddInteract() { void ModelComponent::AddInteract() {
LOG("adding interact %i", m_NumListeningInteract); LOG_DEBUG("adding interact %i", m_NumListeningInteract);
m_Dirty = true; m_Dirty = true;
m_NumListeningInteract++; m_NumListeningInteract++;
} }
void ModelComponent::RemoveInteract() { void ModelComponent::RemoveInteract() {
DluAssert(m_NumListeningInteract > 0); DluAssert(m_NumListeningInteract > 0);
LOG("Removing interact %i", m_NumListeningInteract); LOG_DEBUG("Removing interact %i", m_NumListeningInteract);
m_Dirty = true; m_Dirty = true;
m_NumListeningInteract--; m_NumListeningInteract--;
} }

@ -82,6 +82,8 @@ void Strip::HandleMsg(MigrateActionsMessage& msg) {
template<> template<>
void Strip::HandleMsg(GameMessages::RequestUse& msg) { void Strip::HandleMsg(GameMessages::RequestUse& msg) {
if (m_PausedTime > 0.0f) return;
if (m_Actions[m_NextActionIndex].GetType() == "OnInteract") { if (m_Actions[m_NextActionIndex].GetType() == "OnInteract") {
IncrementAction(); IncrementAction();
m_WaitingForAction = false; m_WaitingForAction = false;