You've already forked Arcturus-Morningstar-Extended
mirror of
https://github.com/duckietm/Arcturus-Morningstar-Extended.git
synced 2026-06-20 07:26:18 +00:00
fix(items): require seed ownership for monsterplants
Reject monsterplant seed redemption when the caller does not own the placed seed. Without this guard, a user in the same room could trigger ToggleFloorItemEvent against another user's seed and have the server delete that item while creating the monsterplant pet for the attacker. Add a contract test covering the ownership guard before createMonsterplant is reached.
This commit is contained in:
+4
@@ -103,6 +103,10 @@ public class ToggleFloorItemEvent extends MessageHandler {
|
||||
|
||||
// Do not move to onClick(). Wired could trigger it.
|
||||
if (item instanceof InteractionMonsterPlantSeed) {
|
||||
if (item.getUserId() != this.client.getHabbo().getHabboInfo().getId()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Emulator.getThreading().run(new QueryDeleteHabboItem(item.getId()));
|
||||
|
||||
boolean isRare = item.getBaseItem().getName().contains("rare");
|
||||
|
||||
Reference in New Issue
Block a user