This commit is contained in:
Snaiker 2022-03-21 18:37:24 +00:00
parent b8b5b4b576
commit 797b887a98
2 changed files with 5 additions and 1 deletions

View File

@ -57,6 +57,9 @@ public class HabboBadge implements Runnable {
public void run() {
try {
if (this.needsInsert) {
if (this.habbo.getInventory().getBadgesComponent().hasBadge(this.code))
return;
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("INSERT INTO users_badges (user_id, slot_id, badge_code) VALUES (?, ?, ?)", Statement.RETURN_GENERATED_KEYS)) {
statement.setInt(1, this.habbo.getHabboInfo().getId());
statement.setInt(2, this.slot);

View File

@ -160,6 +160,7 @@ public class BadgesComponent {
public void addBadge(HabboBadge badge) {
synchronized (this.badges) {
if (!this.hasBadge(badge.getCode()))
this.badges.add(badge);
}
}