mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-26 16:30:52 +01:00
Fixed rank badges disappearing
This commit is contained in:
parent
d14f5a8f49
commit
4deccd7535
@ -54,7 +54,7 @@ public class BadgeCommand extends Command
|
||||
{
|
||||
boolean found;
|
||||
|
||||
try (PreparedStatement statement = connection.prepareStatement("SELECT badge_code FROM users_badges INNER JOIN users ON users.id = user_id WHERE users.username = ? AND badge_code = ? LIMIT 1"))
|
||||
try (PreparedStatement statement = connection.prepareStatement("SELECT `badge_code` FROM `users_badges` INNER JOIN `users` ON `users`.`id` = `user_id` WHERE `users`.`username` = ? AND `badge_code` = ? LIMIT 1"))
|
||||
{
|
||||
statement.setString(1, params[1]);
|
||||
statement.setString(2, params[2]);
|
||||
@ -71,7 +71,7 @@ public class BadgeCommand extends Command
|
||||
}
|
||||
else
|
||||
{
|
||||
try (PreparedStatement statement = connection.prepareStatement("INSERT INTO users_badges VALUES (null, (SELECT id FROM users WHERE username = ? LIMIT 1), 0, ?)"))
|
||||
try (PreparedStatement statement = connection.prepareStatement("INSERT INTO users_badges (`id`, `user_id`, `slot_id`, `badge_code`) VALUES (null, (SELECT `id` FROM `users` WHERE `username` = ? LIMIT 1), 0, ?)"))
|
||||
{
|
||||
statement.setString(1, params[1]);
|
||||
statement.setString(2, params[2]);
|
||||
|
@ -333,7 +333,7 @@ public class HabboManager
|
||||
if (!oldRank.getBadge().isEmpty())
|
||||
{
|
||||
habbo.deleteBadge(habbo.getInventory().getBadgesComponent().getBadge(oldRank.getBadge()));
|
||||
BadgesComponent.deleteBadge(userId, oldRank.getBadge());
|
||||
//BadgesComponent.deleteBadge(userId, oldRank.getBadge()); // unnecessary as Habbo.deleteBadge does this
|
||||
}
|
||||
|
||||
habbo.getHabboInfo().setRank(newRank);
|
||||
|
@ -43,7 +43,7 @@ public class BadgesComponent
|
||||
|
||||
for (Rank rank : Emulator.getGameEnvironment().getPermissionsManager().getRanks(badge.getCode()))
|
||||
{
|
||||
if (rank.getId() == habbo.getHabboInfo().getId())
|
||||
if (rank.getId() == habbo.getHabboInfo().getRank().getId())
|
||||
{
|
||||
delete = false;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user