Check guild membership

This commit is contained in:
Alejandro 2020-06-07 14:52:07 +03:00
parent ff021608f5
commit db14789d6b

View File

@ -1019,23 +1019,23 @@ public class CatalogManager {
return; return;
} }
InteractionGuildFurni habboItem = (InteractionGuildFurni) Emulator.getGameEnvironment().getItemManager().createItem(habbo.getClient().getHabbo().getHabboInfo().getId(), baseItem, limitedStack, limitedNumber, extradata); Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId);
habboItem.setExtradata("");
habboItem.needsUpdate(true);
Emulator.getThreading().run(habboItem); if (guild != null && Emulator.getGameEnvironment().getGuildManager().getGuildMember(guild, habbo) != null) {
Emulator.getGameEnvironment().getGuildManager().setGuild(habboItem, guildId); InteractionGuildFurni habboItem = (InteractionGuildFurni) Emulator.getGameEnvironment().getItemManager().createItem(habbo.getClient().getHabbo().getHabboInfo().getId(), baseItem, limitedStack, limitedNumber, extradata);
itemsList.add(habboItem); habboItem.setExtradata("");
habboItem.needsUpdate(true);
if (baseItem.getName().equals("guild_forum")) { Emulator.getThreading().run(habboItem);
Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId); Emulator.getGameEnvironment().getGuildManager().setGuild(habboItem, guildId);
if (guild != null) { itemsList.add(habboItem);
if (baseItem.getName().equals("guild_forum")) {
guild.setForum(true); guild.setForum(true);
guild.needsUpdate = true; guild.needsUpdate = true;
guild.run(); guild.run();
} }
} }
} else if (baseItem.getInteractionType().getType() == InteractionMusicDisc.class) { } else if (baseItem.getInteractionType().getType() == InteractionMusicDisc.class) {
SoundTrack track = Emulator.getGameEnvironment().getItemManager().getSoundTrack(item.getExtradata()); SoundTrack track = Emulator.getGameEnvironment().getItemManager().getSoundTrack(item.getExtradata());