Commit a1bb93a7 authored by Harmony's avatar Harmony

Merge branch 'fix/gift-achievement' into 'dev'

#944 Gifting yourself won't progress achievements anymore

See merge request !400
parents 1949ed4c f5275277
Pipeline #1699 passed with stage
in 20 seconds
......@@ -336,7 +336,10 @@ public class CatalogBuyItemAsGiftEvent extends MessageHandler {
return;
}
AchievementManager.progressAchievement(this.client.getHabbo(), Emulator.getGameEnvironment().getAchievementManager().getAchievement("GiftGiver"));
if (this.client.getHabbo().getHabboInfo().getId() != userId) {
AchievementManager.progressAchievement(this.client.getHabbo(), Emulator.getGameEnvironment().getAchievementManager().getAchievement("GiftGiver"));
}
if (habbo != null) {
habbo.getClient().sendResponse(new AddHabboItemComposer(gift));
habbo.getClient().getHabbo().getInventory().getItemsComponent().addItem(gift);
......@@ -351,7 +354,9 @@ public class CatalogBuyItemAsGiftEvent extends MessageHandler {
habbo.getClient().sendResponse(new BubbleAlertComposer(BubbleAlertKeys.RECEIVED_BADGE.key, keys));
}
AchievementManager.progressAchievement(userId, Emulator.getGameEnvironment().getAchievementManager().getAchievement("GiftReceiver"));
if (this.client.getHabbo().getHabboInfo().getId() != userId) {
AchievementManager.progressAchievement(userId, Emulator.getGameEnvironment().getAchievementManager().getAchievement("GiftReceiver"));
}
if (!this.client.getHabbo().hasPermission(Permission.ACC_INFINITE_CREDITS)) {
if (totalCredits > 0) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment