Skip to content

Commit

Permalink
Fixed issue (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
RedLime committed Dec 29, 2021
1 parent 85f5aee commit 3e55290
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Expand Up @@ -9,7 +9,7 @@ org.gradle.jvmargs=-Xmx1G
loader_version=0.12.2

# Mod Properties
mod_version = 2.15.1+1.15.2
mod_version = 2.15.2+1.15.2
maven_group = com.redlimerl.speedrunigt
archives_base_name = SpeedRunIGT

Expand Down
Expand Up @@ -124,8 +124,9 @@ public static String timeToStringFormat(long time) {
*/
public static void complete() {
COMPLETED_INSTANCE = new Gson().fromJson(new Gson().toJson(INSTANCE), InGameTimer.class);
InGameTimer timer = COMPLETED_INSTANCE;
COMPLETED_INSTANCE.isCompleted = false;
INSTANCE.isCompleted = true;
InGameTimer timer = COMPLETED_INSTANCE;

if (timer.getStatus() == TimerStatus.COMPLETED_LEGACY) return;
timer.endTime = System.currentTimeMillis();
Expand Down Expand Up @@ -256,13 +257,13 @@ public long getRealTimeAttack() {
}

public long getRealTimeAttack(boolean withRebased) {
return this.isCompleted ? COMPLETED_INSTANCE.getRealTimeAttack(withRebased) : this.getStatus() == TimerStatus.NONE ? 0 : this.getEndTime() - this.getStartTime() + (withRebased ? rebaseRealTime : 0) - this.excludedTime;
return this.isCompleted && this != COMPLETED_INSTANCE ? COMPLETED_INSTANCE.getRealTimeAttack(withRebased) : this.getStatus() == TimerStatus.NONE ? 0 : this.getEndTime() - this.getStartTime() + (withRebased ? rebaseRealTime : 0) - this.excludedTime;
}

public long getInGameTime() { return getInGameTime(true); }

public long getInGameTime(boolean smooth) {
if (this.isCompleted) return COMPLETED_INSTANCE.getInGameTime(smooth);
if (this.isCompleted && this != COMPLETED_INSTANCE) return COMPLETED_INSTANCE.getInGameTime(smooth);

long ms = System.currentTimeMillis();
return !isStarted() ? 0 :
Expand Down

0 comments on commit 3e55290

Please sign in to comment.