mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2025-01-31 12:22:36 +01:00
Fix renting spaces
This commit is contained in:
parent
0ee867a2fa
commit
732910e3fc
@ -4,10 +4,7 @@ import com.eu.habbo.Emulator;
|
|||||||
import com.eu.habbo.habbohotel.bots.Bot;
|
import com.eu.habbo.habbohotel.bots.Bot;
|
||||||
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
||||||
import com.eu.habbo.habbohotel.items.Item;
|
import com.eu.habbo.habbohotel.items.Item;
|
||||||
import com.eu.habbo.habbohotel.rooms.Room;
|
import com.eu.habbo.habbohotel.rooms.*;
|
||||||
import com.eu.habbo.habbohotel.rooms.RoomTile;
|
|
||||||
import com.eu.habbo.habbohotel.rooms.RoomUnit;
|
|
||||||
import com.eu.habbo.habbohotel.rooms.RoomUnitType;
|
|
||||||
import com.eu.habbo.habbohotel.users.Habbo;
|
import com.eu.habbo.habbohotel.users.Habbo;
|
||||||
import com.eu.habbo.habbohotel.users.HabboGender;
|
import com.eu.habbo.habbohotel.users.HabboGender;
|
||||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
import com.eu.habbo.habbohotel.users.HabboItem;
|
||||||
@ -181,7 +178,14 @@ public class InteractionDefault extends HabboItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean canToggle(Habbo habbo, Room room) {
|
public boolean canToggle(Habbo habbo, Room room) {
|
||||||
return room.hasRights(habbo);
|
if (room.hasRights(habbo)) return true;
|
||||||
|
|
||||||
|
if (!habbo.getHabboStats().isRentingSpace()) return false;
|
||||||
|
|
||||||
|
HabboItem rentSpace = room.getHabboItem(habbo.getHabboStats().rentedItemId);
|
||||||
|
|
||||||
|
return rentSpace != null && RoomLayout.squareInSquare(RoomLayout.getRectangle(rentSpace.getX(), rentSpace.getY(), rentSpace.getBaseItem().getWidth(), rentSpace.getBaseItem().getLength(), rentSpace.getRotation()), RoomLayout.getRectangle(this.getX(), this.getY(), this.getBaseItem().getWidth(), this.getBaseItem().getLength(), this.getRotation()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -75,8 +75,6 @@ public class RoomPlaceItemEvent extends MessageHandler {
|
|||||||
this.client.sendResponse(new BubbleAlertComposer(BubbleAlertKeys.FURNITURE_PLACEMENT_ERROR.key, FurnitureMovementError.NO_RIGHTS.errorCode));
|
this.client.sendResponse(new BubbleAlertComposer(BubbleAlertKeys.FURNITURE_PLACEMENT_ERROR.key, FurnitureMovementError.NO_RIGHTS.errorCode));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RoomTile tile = room.getLayout().getTile(x, y);
|
RoomTile tile = room.getLayout().getTile(x, y);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user