Only save the previous position as well if it is null.

This commit is contained in:
graywolf336 2013-12-25 23:06:00 -06:00
parent 69b7981914
commit 23e7aa15a3

View File

@ -218,6 +218,7 @@ public class JailIO {
flat.set(cNode + "prisoner.time", p.getRemainingTime()); flat.set(cNode + "prisoner.time", p.getRemainingTime());
flat.set(cNode + "prisoner.offlinePending", p.isOfflinePending()); flat.set(cNode + "prisoner.offlinePending", p.isOfflinePending());
flat.set(cNode + "prisoner.reason", p.getReason()); flat.set(cNode + "prisoner.reason", p.getReason());
if(p.getPreviousLocationString() != null)
flat.set(cNode + "prisoner.previousLocation", p.getPreviousLocationString()); flat.set(cNode + "prisoner.previousLocation", p.getPreviousLocationString());
if(p.getPreviousGameMode() != null) if(p.getPreviousGameMode() != null)
flat.set(cNode + "prisoner.previousGameMode", p.getPreviousGameMode().toString()); flat.set(cNode + "prisoner.previousGameMode", p.getPreviousGameMode().toString());
@ -230,6 +231,7 @@ public class JailIO {
flat.set(pNode + "time", p.getRemainingTime()); flat.set(pNode + "time", p.getRemainingTime());
flat.set(pNode + "offlinePending", p.isOfflinePending()); flat.set(pNode + "offlinePending", p.isOfflinePending());
flat.set(pNode + "reason", p.getReason()); flat.set(pNode + "reason", p.getReason());
if(p.getPreviousLocationString() != null)
flat.set(pNode + "previousLocation", p.getPreviousLocationString()); flat.set(pNode + "previousLocation", p.getPreviousLocationString());
if(p.getPreviousGameMode() != null) if(p.getPreviousGameMode() != null)
flat.set(pNode + "previousGameMode", p.getPreviousGameMode().toString()); flat.set(pNode + "previousGameMode", p.getPreviousGameMode().toString());