Skip to content

Commit 81b100f

Browse files
committed
equipRequest, check if player have a backpack
1 parent d1b961b commit 81b100f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

core/player.class.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -519,9 +519,16 @@ public function equipRequest($serial = null, $layer = null, $container = null) {
519519
if (!in_array($instance->layer, [LayersDefs::HAND_ONE, LayersDefs::HAND_TWO, LayersDefs::SHOES, LayersDefs::PANTS, LayersDefs::SHIRT, LayersDefs::HELM, LayersDefs::GLOVES, LayersDefs::RING, LayersDefs::TALISMAN, LayersDefs::NECK, LayersDefs::WAIST, LayersDefs::INNER_TORSO, LayersDefs::BRACELET, LayersDefs::MIDDLE_TORSO, LayersDefs::EAR_RINGS, LayersDefs::ARMS, LayersDefs::CLOAK, LayersDefs::OUTER_TORSO, LayersDefs::OUTER_LEGS, LayersDefs::INNER_LEGS])) {
520520
// Sends the item to the player's backpack in case it doesn't fit the layer or the item isn't implemented yet
521521
if ($this->layers[LayersDefs::DRAGGING] == $serial) {
522-
$this->dropItem($serial, false, $container, true);
522+
// TODO: Add weight checks if the player has a backpack
523+
if (empty($this->layers[LayersDefs::BACKPACK])) {
524+
$msg = "You don't know what to do with this item. You put it on the ground.";
525+
$this->dropItem($serial, $this->position, 'FFFFFFFF', false);
526+
} else {
527+
$this->dropItem($serial, false, $this->layers[LayersDefs::BACKPACK], false);
528+
$msg = "You don't know what to do with this item. You put it on yours backpack.";
529+
}
530+
new SysmessageCommand($this->client, [$msg]);
523531
}
524-
new SysmessageCommand($this->client, ["You don't know what to do with this item."]);
525532
return false;
526533
}
527534

0 commit comments

Comments
 (0)