mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-22 15:00:52 +01:00
Fixs
This commit is contained in:
parent
797b887a98
commit
a5e9fba8e4
@ -380,7 +380,7 @@ public class Habbo implements Runnable {
|
||||
|
||||
|
||||
public boolean addBadge(String code) {
|
||||
if (this.habboInventory.getBadgesComponent().getBadge(code) == null) {
|
||||
if (!this.habboInventory.getBadgesComponent().hasBadge(code)) {
|
||||
HabboBadge badge = BadgesComponent.createBadge(code, this);
|
||||
this.habboInventory.getBadgesComponent().addBadge(badge);
|
||||
this.client.sendResponse(new AddUserBadgeComposer(badge));
|
||||
|
@ -57,9 +57,6 @@ 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);
|
||||
|
@ -160,8 +160,7 @@ public class BadgesComponent {
|
||||
|
||||
public void addBadge(HabboBadge badge) {
|
||||
synchronized (this.badges) {
|
||||
if (!this.hasBadge(badge.getCode()))
|
||||
this.badges.add(badge);
|
||||
this.badges.add(badge);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -306,6 +306,9 @@ public class WiredHandler {
|
||||
|
||||
if (rewardReceived.value.isEmpty())
|
||||
return;
|
||||
|
||||
if (habbo.getInventory().getBadgesComponent().hasBadge(rewardReceived.value))
|
||||
return;
|
||||
|
||||
HabboBadge badge = new HabboBadge(0, rewardReceived.value, 0, habbo);
|
||||
Emulator.getThreading().run(badge);
|
||||
|
@ -52,7 +52,7 @@ public class AnswerPollEvent extends MessageHandler {
|
||||
|
||||
if (poll.lastQuestionId == questionId) {
|
||||
if (poll.badgeReward.length() > 0) {
|
||||
if (this.client.getHabbo().getInventory().getBadgesComponent().getBadge(poll.badgeReward) == null) {
|
||||
if (!this.client.getHabbo().getInventory().getBadgesComponent().hasBadge(poll.badgeReward)) {
|
||||
HabboBadge badge = new HabboBadge(0, poll.badgeReward, 0, this.client.getHabbo());
|
||||
Emulator.getThreading().run(badge);
|
||||
this.client.getHabbo().getInventory().getBadgesComponent().addBadge(badge);
|
||||
|
Loading…
Reference in New Issue
Block a user