From db14789d6b0bc329683dc0b0f1986bed4059c45f Mon Sep 17 00:00:00 2001 From: Alejandro <25-alejandro@users.noreply.git.krews.org> Date: Sun, 7 Jun 2020 14:52:07 +0300 Subject: [PATCH] Check guild membership --- .../habbohotel/catalog/CatalogManager.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/eu/habbo/habbohotel/catalog/CatalogManager.java b/src/main/java/com/eu/habbo/habbohotel/catalog/CatalogManager.java index eea7f628..255031af 100644 --- a/src/main/java/com/eu/habbo/habbohotel/catalog/CatalogManager.java +++ b/src/main/java/com/eu/habbo/habbohotel/catalog/CatalogManager.java @@ -1019,23 +1019,23 @@ public class CatalogManager { return; } - InteractionGuildFurni habboItem = (InteractionGuildFurni) Emulator.getGameEnvironment().getItemManager().createItem(habbo.getClient().getHabbo().getHabboInfo().getId(), baseItem, limitedStack, limitedNumber, extradata); - habboItem.setExtradata(""); - habboItem.needsUpdate(true); + Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId); - Emulator.getThreading().run(habboItem); - Emulator.getGameEnvironment().getGuildManager().setGuild(habboItem, guildId); - itemsList.add(habboItem); + if (guild != null && Emulator.getGameEnvironment().getGuildManager().getGuildMember(guild, habbo) != null) { + InteractionGuildFurni habboItem = (InteractionGuildFurni) Emulator.getGameEnvironment().getItemManager().createItem(habbo.getClient().getHabbo().getHabboInfo().getId(), baseItem, limitedStack, limitedNumber, extradata); + habboItem.setExtradata(""); + habboItem.needsUpdate(true); - if (baseItem.getName().equals("guild_forum")) { - Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId); - if (guild != null) { + Emulator.getThreading().run(habboItem); + Emulator.getGameEnvironment().getGuildManager().setGuild(habboItem, guildId); + itemsList.add(habboItem); + + if (baseItem.getName().equals("guild_forum")) { guild.setForum(true); guild.needsUpdate = true; guild.run(); } } - } else if (baseItem.getInteractionType().getType() == InteractionMusicDisc.class) { SoundTrack track = Emulator.getGameEnvironment().getItemManager().getSoundTrack(item.getExtradata());