Merge branch 'background-toner-fix' into 'dev'

fixed issue #698

See merge request morningstar/Arcturus-Community!260
This commit is contained in:
Harmonic 2020-07-13 17:02:56 -04:00
commit d808ccda9c
2 changed files with 14 additions and 0 deletions

View File

@ -33,6 +33,9 @@ INSERT INTO `emulator_settings`(`key`, `value`) VALUES ('hotel.flood.mute.time',
INSERT INTO `emulator_settings`(`key`, `value`) VALUES ('hotel.jukebox.limit.large', '20');
INSERT INTO `emulator_settings`(`key`, `value`) VALUES ('hotel.jukebox.limit.normal', '10');
-- Background Toner Scripter Warning
INSERT INTO `emulator_texts`(`key`, `value`) VALUES ('scripter.warning.item.bgtoner.permission', '%username% tried to change the background toner without rights in %room% owned by %owner%');
-- Table structure for room_trax
DROP TABLE IF EXISTS `room_trax`;
CREATE TABLE `room_trax` (

View File

@ -3,6 +3,7 @@ package com.eu.habbo.habbohotel.items.interactions;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.items.Item;
import com.eu.habbo.habbohotel.modtool.ScripterManager;
import com.eu.habbo.habbohotel.rooms.Room;
import com.eu.habbo.habbohotel.rooms.RoomUnit;
import com.eu.habbo.habbohotel.users.HabboItem;
@ -60,6 +61,16 @@ public class InteractionBackgroundToner extends HabboItem {
if(client != null)
{
if (!client.getHabbo().getRoomUnit().getRoom().hasRights(client.getHabbo())) {
ScripterManager.scripterDetected(
client,
Emulator.getTexts().getValue("scripter.warning.item.bgtoner.permission").replace("%username%", client.getHabbo().getHabboInfo().getUsername())
.replace("%room%", room.getName())
.replace("%owner%", room.getOwnerName())
);
return;
}
if (client.getHabbo().getRoomUnit().cmdSit && client.getHabbo().getRoomUnit().getEffectId() == 1337) {
new BackgroundAnimation(this, room).run();
return;