Fix database loading data for wrong player

Fixes #2223
This commit is contained in:
Shevchik 2014-08-24 23:20:01 +04:00 committed by TfT_02
parent 7da661546f
commit 9d7faf9ed9

View File

@ -470,7 +470,12 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
// Find if the line contains the player we want. // Find if the line contains the player we want.
String[] character = line.split(":"); String[] character = line.split(":");
if ((uuid != null && (!character[41].equalsIgnoreCase(uuid.toString()) && !character[41].equalsIgnoreCase("NULL"))) || (uuid == null && !character[0].equalsIgnoreCase(playerName))) { // Compare names because we don't have a valid uuid for that player even if input uuid is not null
if (character[41].equalsIgnoreCase("NULL") && !character[0].equalsIgnoreCase(playerName)) {
continue;
}
// If input uuid is not null then we should compare uuids
else if ((uuid != null && !character[41].equalsIgnoreCase(uuid.toString())) || (!character[0].equalsIgnoreCase(playerName))) {
continue; continue;
} }