OSDN Git Service

fixed by kaneko-san about byoyomi
authornabeken <nabeken@b8c68f68-1e22-0410-b08e-880e1f8202b4>
Thu, 25 Aug 2005 13:34:54 +0000 (13:34 +0000)
committernabeken <nabeken@b8c68f68-1e22-0410-b08e-880e1f8202b4>
Thu, 25 Aug 2005 13:34:54 +0000 (13:34 +0000)
shogi-server

index 65f991f..cc3dd74 100755 (executable)
@@ -1256,15 +1256,14 @@ class Game
       t = Least_Time_Per_Move if (t < Least_Time_Per_Move)
       
       move_status = nil
       t = Least_Time_Per_Move if (t < Least_Time_Per_Move)
       
       move_status = nil
-      if ((@current_player.mytime - t <= 0) && (@total_time > 0))
+      if ((@current_player.mytime - t <= -@byoyomi) && ((@total_time > 0) || (@byoyomi > 0)))
         status = :timeout
       elsif (str == :timeout)
         return false            # time isn't expired. players aren't swapped. continue game
       else
         status = :timeout
       elsif (str == :timeout)
         return false            # time isn't expired. players aren't swapped. continue game
       else
-        if (@current_player.mytime - t < @byoyomi)
-          @current_player.mytime = @byoyomi
-        else
-          @current_player.mytime = @current_player.mytime - t
+        @current_player.mytime = @current_player.mytime - t
+        if (@current_player.mytime < 0)
+          @current_player.mytime = 0
         end
 
 #        begin
         end
 
 #        begin