Skip to content

Commit 9968cc2

Browse files
committed
Fixed another bug for the username, result from the previous commit.
1 parent c5dd785 commit 9968cc2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/com/redomar/game/entities/Player.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,10 @@ public String getSanitisedUsername() {
229229

230230
return guestPlayerName;
231231
} else
232+
if(nameOffset == 0){
233+
int offsetUnit = ((userName.length() & 1) == 0 ? fontCharSize / 2 : 0);
234+
nameOffset = (userName.length() / 2) * fontCharSize - offsetUnit;
235+
}
232236
return this.getUsername();
233237
}
234238

0 commit comments

Comments
 (0)