mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-04 04:12:25 +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) {
|
if (item_id > 0) {
|
||||||
std::unique_ptr<EQ::ItemInstance> inst(database.CreateItem(item_id, charges));
|
std::unique_ptr<EQ::ItemInstance> inst(database.CreateItem(item_id, charges));
|
||||||
bool stacked = c->TryStacking(inst.get());
|
if (inst && inst->GetItem()) {
|
||||||
if (!stacked) {
|
bool stacked = c->TryStacking(inst.get());
|
||||||
int16_t slot = c->GetInv().FindFreeSlot(inst->IsClassBag(), true, inst->GetItem()->Size);
|
if (!stacked) {
|
||||||
c->SummonItem(item_id, charges, 0, 0, 0, 0, 0, 0, false, slot);
|
int16_t slot = c->GetInv().FindFreeSlot(inst->IsClassBag(), true, inst->GetItem()->Size);
|
||||||
if (item_data) {
|
c->SummonItem(item_id, charges, 0, 0, 0, 0, 0, 0, false, slot);
|
||||||
c->MessageString(Chat::Yellow, YOU_HAVE_BEEN_GIVEN, inst->GetItem()->Name);
|
if (item_data) {
|
||||||
|
c->MessageString(Chat::Yellow, YOU_HAVE_BEEN_GIVEN, inst->GetItem()->Name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user