Skip to content
Permalink
Browse files

fixed issue when pausing two times or resuming two times

  • Loading branch information...
Jake Fonseca
Jake Fonseca committed Oct 21, 2014
1 parent a57d23d commit c6d1fa6400f87153790dee240e7675e2f7f5d8e7
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/OCCPGameServer/gameclock.rb
@@ -55,6 +55,9 @@ def start
end

def resume
if @clockstate === :running
return true
end
@mutex.synchronize do
@lastreadtime = Time.now
@clockstate = :running
@@ -63,6 +66,9 @@ def resume
end

def pause
if @clockstate === :paused
return true
end
stopwatchdog
@mutex.synchronize do
@gametime = Time.now - @lastreadtime + @gametime

0 comments on commit c6d1fa6

Please sign in to comment.
You can’t perform that action at this time.