Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 766cfa3

Browse files
committed
Added some checks to ThrownDevice ResetAllTimers so it un-resets activation timer when the device is activated. This only really applies to TDs so I'm putting it there instead of HD
1 parent 77eadca commit 766cfa3

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

Entities/ThrownDevice.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,19 @@ namespace RTE {
102102
Clear();
103103
}
104104

105+
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
106+
107+
void ThrownDevice::ResetAllTimers() {
108+
double elapsedTime;
109+
if (m_Activated) {
110+
elapsedTime = m_ActivationTmr.GetElapsedSimTimeMS();
111+
}
112+
HeldDevice::ResetAllTimers();
113+
if (m_Activated) {
114+
m_ActivationTmr.SetElapsedSimTimeMS(elapsedTime);
115+
}
116+
}
117+
105118
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
106119

107120
void ThrownDevice::Activate() {

Entities/ThrownDevice.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ namespace RTE {
7676
/// <summary>
7777
/// Resets all the timers used by this (e.g. emitters, etc). This is to prevent backed up emissions from coming out all at once while this has been held dormant in an inventory.
7878
/// </summary>
79-
virtual void ResetAllTimers() { HeldDevice::ResetAllTimers(); m_ThrownTmr.Reset(); }
79+
virtual void ResetAllTimers();
8080

8181
/// <summary>
8282
/// Activates this Device as long as it's not set to activate when released or it has no parent.

0 commit comments

Comments
 (0)