mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 07:18:37 +00:00
[Zone] Zone State Automated Testing and Improvements (#4808)
* [Zone] Zone State Automated Testing and Improvements * Spawn condition * Update zone.cpp * Remove redundant logic * Update zone_state.cpp * TestZLocationDrift * Protect NPC resumed NPC's from being able to die
This commit is contained in:
@@ -196,3 +196,25 @@ const uint32 Timer::SetCurrentTime()
|
||||
return current_time;
|
||||
}
|
||||
|
||||
const uint32 Timer::RollForward(uint32 seconds)
|
||||
{
|
||||
struct timeval read_time{};
|
||||
uint32 this_time;
|
||||
|
||||
gettimeofday(&read_time, nullptr);
|
||||
this_time = read_time.tv_sec * 1000 + read_time.tv_usec / 1000;
|
||||
|
||||
if (last_time == 0) {
|
||||
current_time = 0;
|
||||
}
|
||||
else {
|
||||
current_time += this_time - last_time;
|
||||
}
|
||||
|
||||
last_time = this_time;
|
||||
|
||||
// Roll forward the specified number of seconds (converted to milliseconds)
|
||||
current_time += seconds * 1000;
|
||||
|
||||
return current_time;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user