Fix guild admin removing

This commit is contained in:
Alejandro 2019-08-11 12:15:39 +03:00
parent 1c387eff51
commit 79b02b80a6

View File

@ -22,19 +22,20 @@ public class GuildRemoveAdminEvent extends MessageHandler {
int userId = this.packet.readInt();
Room room = Emulator.getGameEnvironment().getRoomManager().getRoom(guild.getRoomId());
Emulator.getGameEnvironment().getGuildManager().removeAdmin(guild, userId);
Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId);
Habbo habbo = room.getHabbo(userId);
GuildRemovedAdminEvent removedAdminEvent = new GuildRemovedAdminEvent(guild, userId, habbo);
Emulator.getPluginManager().fireEvent(removedAdminEvent);
if (removedAdminEvent.isCancelled())
return;
Emulator.getGameEnvironment().getGuildManager().removeAdmin(guild, userId);
if (habbo != null) {
habbo.getClient().sendResponse(new GuildInfoComposer(guild, this.client, false, Emulator.getGameEnvironment().getGuildManager().getGuildMember(guild.getId(), userId)));
room.refreshRightsForHabbo(habbo);
if (room != null && habbo.getHabboInfo().getCurrentRoom() != null && habbo.getHabboInfo().getCurrentRoom() == room) room.refreshRightsForHabbo(habbo);
}
GuildMember guildMember = Emulator.getGameEnvironment().getGuildManager().getGuildMember(guildId, userId);