mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-30 23:21:29 +00:00
Validate reward item instance
This commit is contained in:
parent
494789f8d0
commit
9f1519cd94
@ -991,12 +991,14 @@ void ClientTaskState::RewardTask(Client *c, const TaskInformation *ti, ClientTas
|
||||
|
||||
if (item_id > 0) {
|
||||
std::unique_ptr<EQ::ItemInstance> inst(database.CreateItem(item_id, charges));
|
||||
bool stacked = c->TryStacking(inst.get());
|
||||
if (!stacked) {
|
||||
int16_t slot = c->GetInv().FindFreeSlot(inst->IsClassBag(), true, inst->GetItem()->Size);
|
||||
c->SummonItem(item_id, charges, 0, 0, 0, 0, 0, 0, false, slot);
|
||||
if (item_data) {
|
||||
c->MessageString(Chat::Yellow, YOU_HAVE_BEEN_GIVEN, inst->GetItem()->Name);
|
||||
if (inst && inst->GetItem()) {
|
||||
bool stacked = c->TryStacking(inst.get());
|
||||
if (!stacked) {
|
||||
int16_t slot = c->GetInv().FindFreeSlot(inst->IsClassBag(), true, inst->GetItem()->Size);
|
||||
c->SummonItem(item_id, charges, 0, 0, 0, 0, 0, 0, false, slot);
|
||||
if (item_data) {
|
||||
c->MessageString(Chat::Yellow, YOU_HAVE_BEEN_GIVEN, inst->GetItem()->Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user