mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-04-28 15:57:59 +03:00
Use level time for volume timestamps, as using GlobalCounter may be inconsistent
This commit is contained in:
parent
625131fbb7
commit
64c1777023
1 changed files with 5 additions and 5 deletions
|
@ -168,7 +168,7 @@ namespace TEN::Control::Volumes
|
||||||
|
|
||||||
if (candidate.Status == VolumeStateStatus::Leaving)
|
if (candidate.Status == VolumeStateStatus::Leaving)
|
||||||
{
|
{
|
||||||
if ((GlobalCounter - candidate.Timestamp) > VOLUME_BUSY_TIMEOUT)
|
if ((SaveGame::Statistics.Level.TimeTaken - candidate.Timestamp) > VOLUME_BUSY_TIMEOUT)
|
||||||
candidate.Status = VolumeStateStatus::Outside;
|
candidate.Status = VolumeStateStatus::Outside;
|
||||||
}
|
}
|
||||||
else if (candidate.Status != VolumeStateStatus::Outside)
|
else if (candidate.Status != VolumeStateStatus::Outside)
|
||||||
|
@ -191,7 +191,7 @@ namespace TEN::Control::Volumes
|
||||||
{
|
{
|
||||||
VolumeStateStatus::Entering,
|
VolumeStateStatus::Entering,
|
||||||
activator,
|
activator,
|
||||||
GlobalCounter
|
SaveGame::Statistics.Level.TimeTaken
|
||||||
});
|
});
|
||||||
|
|
||||||
HandleEvent(set.Events[(int)EventType::Enter], activator);
|
HandleEvent(set.Events[(int)EventType::Enter], activator);
|
||||||
|
@ -199,7 +199,7 @@ namespace TEN::Control::Volumes
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
entryPtr->Status = VolumeStateStatus::Inside;
|
entryPtr->Status = VolumeStateStatus::Inside;
|
||||||
entryPtr->Timestamp = GlobalCounter;
|
entryPtr->Timestamp = SaveGame::Statistics.Level.TimeTaken;
|
||||||
|
|
||||||
HandleEvent(set.Events[(int)EventType::Inside], activator);
|
HandleEvent(set.Events[(int)EventType::Inside], activator);
|
||||||
}
|
}
|
||||||
|
@ -209,10 +209,10 @@ namespace TEN::Control::Volumes
|
||||||
// Only fire leave event when a certain timeout has passed.
|
// Only fire leave event when a certain timeout has passed.
|
||||||
// This helps to filter out borderline cases when moving around volumes.
|
// This helps to filter out borderline cases when moving around volumes.
|
||||||
|
|
||||||
if ((GlobalCounter - entryPtr->Timestamp) > VOLUME_LEAVE_TIMEOUT)
|
if ((SaveGame::Statistics.Level.TimeTaken - entryPtr->Timestamp) > VOLUME_LEAVE_TIMEOUT)
|
||||||
{
|
{
|
||||||
entryPtr->Status = VolumeStateStatus::Leaving;
|
entryPtr->Status = VolumeStateStatus::Leaving;
|
||||||
entryPtr->Timestamp = GlobalCounter;
|
entryPtr->Timestamp = SaveGame::Statistics.Level.TimeTaken;
|
||||||
|
|
||||||
HandleEvent(set.Events[(int)EventType::Leave], activator);
|
HandleEvent(set.Events[(int)EventType::Leave], activator);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue