mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-11-09 20:31:38 +01:00
Fix #227 (Removed exception throw)
This commit is contained in:
parent
353af2bbad
commit
eb00a94c88
@ -70,9 +70,9 @@ public abstract class TimeKeeper {
|
||||
*/
|
||||
public void changeState(String newState, long playTime) throws IllegalArgumentException, IllegalStateException {
|
||||
Verify.nullCheck(newState);
|
||||
if (playTime < lastStateChange) {
|
||||
throw new IllegalStateException("Given Playtime is lower than last status change time: " + playTime + " / " + lastStateChange);
|
||||
}
|
||||
// if (playTime < lastStateChange) {
|
||||
// throw new IllegalStateException("Given Playtime is lower than last status change time: " + playTime + " / " + lastStateChange);
|
||||
// }
|
||||
if (state == null) {
|
||||
state = newState;
|
||||
}
|
||||
@ -81,7 +81,7 @@ public abstract class TimeKeeper {
|
||||
currentTime = 0L;
|
||||
}
|
||||
long diff = playTime - lastStateChange;
|
||||
times.put(state, currentTime + diff);
|
||||
times.put(state, currentTime + Math.abs(diff));
|
||||
state = newState;
|
||||
lastStateChange = playTime;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user