mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-12-20 03:36:43 -06:00
Compare commits
1 Commits
v3.2.1
...
Restart-be
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
edda646856 |
@@ -63,6 +63,12 @@ void ModelComponent::Update(float deltaTime) {
|
|||||||
for (auto& behavior : m_Behaviors) {
|
for (auto& behavior : m_Behaviors) {
|
||||||
behavior.Update(deltaTime, *this);
|
behavior.Update(deltaTime, *this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!m_RestartAtEndOfFrame) return;
|
||||||
|
|
||||||
|
GameMessages::ResetModelToDefaults reset{};
|
||||||
|
OnResetModelToDefaults(reset);
|
||||||
|
m_RestartAtEndOfFrame = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModelComponent::LoadBehaviors() {
|
void ModelComponent::LoadBehaviors() {
|
||||||
|
|||||||
@@ -146,7 +146,11 @@ public:
|
|||||||
|
|
||||||
void OnChatMessageReceived(const std::string& sMessage);
|
void OnChatMessageReceived(const std::string& sMessage);
|
||||||
|
|
||||||
|
// Sets the speed of the model
|
||||||
void SetSpeed(const float newSpeed) { m_Speed = newSpeed; }
|
void SetSpeed(const float newSpeed) { m_Speed = newSpeed; }
|
||||||
|
|
||||||
|
// Whether or not to restart at the end of the frame
|
||||||
|
void RestartAtEndOfFrame() { m_RestartAtEndOfFrame = true; }
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// Loads a behavior from the database.
|
// Loads a behavior from the database.
|
||||||
@@ -190,4 +194,7 @@ private:
|
|||||||
|
|
||||||
// The speed at which this model moves
|
// The speed at which this model moves
|
||||||
float m_Speed{ 3.0f };
|
float m_Speed{ 3.0f };
|
||||||
|
|
||||||
|
// Whether or not to restart at the end of the frame.
|
||||||
|
bool m_RestartAtEndOfFrame{ false };
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -221,6 +221,8 @@ void Strip::ProcNormalAction(float deltaTime, ModelComponent& modelComponent) {
|
|||||||
sound.target = modelComponent.GetParent()->GetObjectID();
|
sound.target = modelComponent.GetParent()->GetObjectID();
|
||||||
sound.soundID = numberAsInt;
|
sound.soundID = numberAsInt;
|
||||||
sound.Send(UNASSIGNED_SYSTEM_ADDRESS);
|
sound.Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||||
|
} else if (nextActionType == "Restart") {
|
||||||
|
modelComponent.RestartAtEndOfFrame();
|
||||||
}
|
}
|
||||||
/* END Action */
|
/* END Action */
|
||||||
/* BEGIN Gameplay */
|
/* BEGIN Gameplay */
|
||||||
|
|||||||
@@ -65,6 +65,8 @@ private:
|
|||||||
|
|
||||||
// The position of the parent model on the previous frame
|
// The position of the parent model on the previous frame
|
||||||
NiPoint3 m_PreviousFramePosition{};
|
NiPoint3 m_PreviousFramePosition{};
|
||||||
|
|
||||||
|
NiPoint3 m_SavedVelocity{};
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //!__STRIP__H__
|
#endif //!__STRIP__H__
|
||||||
|
|||||||
Reference in New Issue
Block a user