From cc89af0167ff775437651b7d93837255b1e47795 Mon Sep 17 00:00:00 2001 From: Major- Date: Sun, 16 Feb 2014 17:13:25 +0000 Subject: [PATCH] Add explanatory message re: PrivacyState workaround. --- src/org/apollo/game/model/settings/PrivacyState.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/org/apollo/game/model/settings/PrivacyState.java b/src/org/apollo/game/model/settings/PrivacyState.java index ac41576b..48cfc75e 100644 --- a/src/org/apollo/game/model/settings/PrivacyState.java +++ b/src/org/apollo/game/model/settings/PrivacyState.java @@ -69,13 +69,21 @@ public enum PrivacyState { this.value = value; } + /* + * Horrible workarounds are required here because public chat supports ON, HIDE, FRIENDS, and OFF, but trade and + * private only support ON, FRIENDS, and OFF. + */ + /** * Converts this privacy state to an integer. * * @return The numerical value used by the client. */ public int toInteger(boolean chat) { - return chat ? value : (value == 0 ? 0 : value - 1); + if (chat) { + return value; + } + return value == 0 ? 0 : value - 1; } } \ No newline at end of file