Skip to content

Commit

Permalink
fix: fuse or transfer error with no slots in bp
Browse files Browse the repository at this point in the history
  • Loading branch information
carlospess0a committed Dec 29, 2023
1 parent df811d7 commit d94856c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/creatures/players/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6913,6 +6913,12 @@ bool Player::saySpell(

// Forge system
void Player::forgeFuseItems(uint16_t itemId, uint8_t tier, bool success, bool reduceTierLoss, uint8_t bonus, uint8_t coreCount) {
if(this->getFreeBackpackSlots() < 1){
sendCancelMessage("You have no slots in your backpack.");
sendForgeError(RETURNVALUE_NOTENOUGHROOM);
return;
}

ForgeHistory history;
history.actionType = ForgeConversion_t::FORGE_ACTION_FUSION;
history.tier = tier;
Expand Down Expand Up @@ -7121,6 +7127,12 @@ void Player::forgeFuseItems(uint16_t itemId, uint8_t tier, bool success, bool re
}

void Player::forgeTransferItemTier(uint16_t donorItemId, uint8_t tier, uint16_t receiveItemId) {
if(this->getFreeBackpackSlots() < 1){
sendCancelMessage("You have no slots in your backpack.");
sendForgeError(RETURNVALUE_NOTENOUGHROOM);
return;
}

ForgeHistory history;
history.actionType = ForgeConversion_t::FORGE_ACTION_TRANSFER;
history.tier = tier;
Expand Down

0 comments on commit d94856c

Please sign in to comment.