mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-02-27 13:19:48 +00:00
Skip Smashes if they coincide with a UnSmash
Remove debug logs Comment on return
This commit is contained in:
@@ -31,6 +31,7 @@ bool ModelComponent::OnResetModelToDefaults(GameMessages::GameMsg& msg) {
|
||||
unsmash.duration = 0.0f;
|
||||
unsmash.Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
m_NumListeningInteract = 0;
|
||||
m_NumActiveUnSmash = 0;
|
||||
m_Dirty = true;
|
||||
Game::entityManager->SerializeEntity(GetParent());
|
||||
return true;
|
||||
@@ -179,7 +180,7 @@ std::array<std::pair<int32_t, std::string>, 5> ModelComponent::GetBehaviorsForSa
|
||||
}
|
||||
|
||||
void ModelComponent::AddInteract() {
|
||||
LOG_DEBUG("adding interact %i", m_NumListeningInteract);
|
||||
LOG_DEBUG("Adding interact %i", m_NumListeningInteract);
|
||||
m_Dirty = true;
|
||||
m_NumListeningInteract++;
|
||||
}
|
||||
@@ -190,3 +191,15 @@ void ModelComponent::RemoveInteract() {
|
||||
m_Dirty = true;
|
||||
m_NumListeningInteract--;
|
||||
}
|
||||
|
||||
void ModelComponent::AddUnSmash() {
|
||||
LOG_DEBUG("Adding UnSmash %i", m_NumActiveUnSmash);
|
||||
m_NumActiveUnSmash++;
|
||||
}
|
||||
|
||||
void ModelComponent::RemoveUnSmash() {
|
||||
// Players can assign an UnSmash without a Smash so an assert would be bad here
|
||||
if (m_NumActiveUnSmash == 0) return;
|
||||
LOG_DEBUG("Removing UnSmash %i", m_NumActiveUnSmash);
|
||||
m_NumActiveUnSmash--;
|
||||
}
|
||||
|
||||
@@ -125,8 +125,15 @@ public:
|
||||
|
||||
void Pause() { m_Dirty = true; m_IsPaused = true; }
|
||||
|
||||
void AddUnSmash();
|
||||
void RemoveUnSmash();
|
||||
bool IsUnSmashing() const { return m_NumActiveUnSmash != 0; }
|
||||
|
||||
void Resume();
|
||||
private:
|
||||
// Number of Actions that are awaiting an UnSmash to finish.
|
||||
uint32_t m_NumActiveUnSmash{};
|
||||
|
||||
// Whether or not this component needs to have its extra data serialized.
|
||||
bool m_Dirty{};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user