From: David ‘Bombe’ Roden Date: Wed, 18 Apr 2012 04:37:38 +0000 (+0200) Subject: Use the first set value as original. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=291e7c034f1d06938b02758d8cfbe8001900234b;p=demoscenemusic.git Use the first set value as original. --- diff --git a/src/main/java/net/pterodactylus/demoscenemusic/data/AbstractBase.java b/src/main/java/net/pterodactylus/demoscenemusic/data/AbstractBase.java index 4a35db1..6a21081 100644 --- a/src/main/java/net/pterodactylus/demoscenemusic/data/AbstractBase.java +++ b/src/main/java/net/pterodactylus/demoscenemusic/data/AbstractBase.java @@ -51,6 +51,8 @@ public class AbstractBase { private T original; + private boolean originalSet; + private T current; public T get() { @@ -58,6 +60,10 @@ public class AbstractBase { } public Value set(T value) { + if (!originalSet) { + original = value; + originalSet = true; + } current = value; return this; }