mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-13 02:10:03 +00:00
Do not evaluate timers if the server is shutting down
This should fix issues with segfaults when the server is being terminated that sometimes occur because things like NPC path traversal keep running while the process is executing the signal handler.
This commit is contained in:
parent
1ba0f5e14a
commit
eb8e54c1f0
@ -115,6 +115,10 @@ void CNShardServer::kill() {
|
||||
void CNShardServer::onStep() {
|
||||
time_t currTime = getTime();
|
||||
|
||||
// do not evaluate timers if the server is shutting down
|
||||
if (!active)
|
||||
return;
|
||||
|
||||
for (TimerEvent& event : Timers) {
|
||||
if (event.scheduledEvent == 0) {
|
||||
// event hasn't been queued yet, go ahead and do that
|
||||
|
Loading…
Reference in New Issue
Block a user