Skip to content

Commit

Permalink
fix(Core): Prevent gift wrapping of limited duration items (azerothco…
Browse files Browse the repository at this point in the history
…re#18334)

fix(Core): Prevent gift wrapping of items with duration

- remaining duration is not beeing stored in character_gifts
- gift wrapping of items with duration preserved
  them infinitely
  • Loading branch information
sudlud authored Feb 19, 2024
1 parent 7e419fb commit d94d10a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/server/game/Handlers/ItemHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1346,6 +1346,12 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recvData)
return;
}

if (item->GetTemplate()->Duration > 0)
{
_player->SendEquipError(EQUIP_ERR_UNIQUE_CANT_BE_WRAPPED, item, nullptr);
return;
}

CharacterDatabaseTransaction trans = CharacterDatabase.BeginTransaction();

CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_GIFT);
Expand Down

0 comments on commit d94d10a

Please sign in to comment.