mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 14:41:28 +00:00
Fix compiler warnings
This commit is contained in:
parent
f6e544a2e6
commit
9d0f7781b4
@ -448,7 +448,7 @@ void Mob::WakeTheDead(uint16 spell_id, Mob *target, uint32 duration)
|
|||||||
sitem = CorpseToUse->GetWornItem(x);
|
sitem = CorpseToUse->GetWornItem(x);
|
||||||
if(sitem){
|
if(sitem){
|
||||||
const EQ::ItemData * itm = database.GetItem(sitem);
|
const EQ::ItemData * itm = database.GetItem(sitem);
|
||||||
npca->AddLootDrop(itm, &npca->itemlist, LootDropEntries_Struct{ .equip_item = 1 }, true);
|
npca->AddLootDrop(itm, &npca->itemlist, NPC::NewLootDropEntry(), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -277,6 +277,22 @@ bool NPC::MeetsLootDropLevelRequirements(LootDropEntries_Struct loot_drop)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LootDropEntries_Struct NPC::NewLootDropEntry()
|
||||||
|
{
|
||||||
|
LootDropEntries_Struct loot_drop{};
|
||||||
|
loot_drop.item_id = 0;
|
||||||
|
loot_drop.item_charges = 1;
|
||||||
|
loot_drop.equip_item = 1;
|
||||||
|
loot_drop.chance = 0;
|
||||||
|
loot_drop.trivial_min_level = 0;
|
||||||
|
loot_drop.trivial_max_level = 0;
|
||||||
|
loot_drop.npc_min_level = 0;
|
||||||
|
loot_drop.npc_max_level = 0;
|
||||||
|
loot_drop.multiplier = 0;
|
||||||
|
|
||||||
|
return loot_drop;
|
||||||
|
}
|
||||||
|
|
||||||
//if itemlist is null, just send wear changes
|
//if itemlist is null, just send wear changes
|
||||||
void NPC::AddLootDrop(
|
void NPC::AddLootDrop(
|
||||||
const EQ::ItemData *item2,
|
const EQ::ItemData *item2,
|
||||||
@ -509,7 +525,10 @@ void NPC::AddLootDrop(
|
|||||||
|
|
||||||
void NPC::AddItem(const EQ::ItemData* item, uint16 charges, bool equipitem) {
|
void NPC::AddItem(const EQ::ItemData* item, uint16 charges, bool equipitem) {
|
||||||
//slot isnt needed, its determined from the item.
|
//slot isnt needed, its determined from the item.
|
||||||
AddLootDrop(item, &itemlist, LootDropEntries_Struct{ .equip_item = static_cast<uint8>(equipitem ? 1 : 0) }, true);
|
auto loot_drop_entry = NPC::NewLootDropEntry();
|
||||||
|
loot_drop_entry.equip_item = static_cast<uint8>(equipitem ? 1 : 0);
|
||||||
|
|
||||||
|
AddLootDrop(item, &itemlist, loot_drop_entry, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NPC::AddItem(uint32 itemid, uint16 charges, bool equipitem, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, uint32 aug6) {
|
void NPC::AddItem(uint32 itemid, uint16 charges, bool equipitem, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, uint32 aug6) {
|
||||||
@ -517,7 +536,11 @@ void NPC::AddItem(uint32 itemid, uint16 charges, bool equipitem, uint32 aug1, ui
|
|||||||
const EQ::ItemData * i = database.GetItem(itemid);
|
const EQ::ItemData * i = database.GetItem(itemid);
|
||||||
if(i == nullptr)
|
if(i == nullptr)
|
||||||
return;
|
return;
|
||||||
AddLootDrop(i, &itemlist, LootDropEntries_Struct{ .equip_item = equipitem }, true, aug1, aug2, aug3, aug4, aug5, aug6);
|
|
||||||
|
auto loot_drop_entry = NPC::NewLootDropEntry();
|
||||||
|
loot_drop_entry.equip_item = static_cast<uint8>(equipitem ? 1 : 0);
|
||||||
|
|
||||||
|
AddLootDrop(i, &itemlist, loot_drop_entry, true, aug1, aug2, aug3, aug4, aug5, aug6);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NPC::AddLootTable() {
|
void NPC::AddLootTable() {
|
||||||
|
|||||||
@ -495,6 +495,7 @@ public:
|
|||||||
|
|
||||||
void RecalculateSkills();
|
void RecalculateSkills();
|
||||||
|
|
||||||
|
static LootDropEntries_Struct NewLootDropEntry();
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
const NPCType* NPCTypedata;
|
const NPCType* NPCTypedata;
|
||||||
|
|||||||
@ -394,7 +394,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower,
|
|||||||
for (int i = EQ::invslot::EQUIPMENT_BEGIN; i <= EQ::invslot::EQUIPMENT_END; i++)
|
for (int i = EQ::invslot::EQUIPMENT_BEGIN; i <= EQ::invslot::EQUIPMENT_END; i++)
|
||||||
if (petinv[i]) {
|
if (petinv[i]) {
|
||||||
item = database.GetItem(petinv[i]);
|
item = database.GetItem(petinv[i]);
|
||||||
npc->AddLootDrop(item, &npc->itemlist, LootDropEntries_Struct{ .equip_item = 1 }, true);
|
npc->AddLootDrop(item, &npc->itemlist, NPC::NewLootDropEntry(), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -625,7 +625,7 @@ void NPC::SetPetState(SpellBuff_Struct *pet_buffs, uint32 *items) {
|
|||||||
bool petCanHaveNoDrop = (RuleB(Pets, CanTakeNoDrop) && _CLIENTPET(this) && GetPetType() <= petOther);
|
bool petCanHaveNoDrop = (RuleB(Pets, CanTakeNoDrop) && _CLIENTPET(this) && GetPetType() <= petOther);
|
||||||
|
|
||||||
if (!noDrop || petCanHaveNoDrop) {
|
if (!noDrop || petCanHaveNoDrop) {
|
||||||
AddLootDrop(item2, &itemlist, LootDropEntries_Struct{.equip_item = 1}, true);
|
AddLootDrop(item2, &itemlist, NPC::NewLootDropEntry(), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -899,10 +899,15 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
|
|||||||
if (baginst) {
|
if (baginst) {
|
||||||
const EQ::ItemData* bagitem = baginst->GetItem();
|
const EQ::ItemData* bagitem = baginst->GetItem();
|
||||||
if (bagitem && (GetGM() || (bagitem->NoDrop != 0 && baginst->IsAttuned() == false))) {
|
if (bagitem && (GetGM() || (bagitem->NoDrop != 0 && baginst->IsAttuned() == false))) {
|
||||||
|
|
||||||
|
auto loot_drop_entry = NPC::NewLootDropEntry();
|
||||||
|
loot_drop_entry.equip_item = 1;
|
||||||
|
loot_drop_entry.item_charges = static_cast<int8>(baginst->GetCharges());
|
||||||
|
|
||||||
tradingWith->CastToNPC()->AddLootDrop(
|
tradingWith->CastToNPC()->AddLootDrop(
|
||||||
bagitem,
|
bagitem,
|
||||||
&tradingWith->CastToNPC()->itemlist,
|
&tradingWith->CastToNPC()->itemlist,
|
||||||
LootDropEntries_Struct{.item_charges = static_cast<int8>(baginst->GetCharges()), .equip_item = 1 },
|
loot_drop_entry,
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -913,10 +918,14 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto new_loot_drop_entry = NPC::NewLootDropEntry();
|
||||||
|
new_loot_drop_entry.equip_item = 1;
|
||||||
|
new_loot_drop_entry.item_charges = static_cast<int8>(inst->GetCharges());
|
||||||
|
|
||||||
tradingWith->CastToNPC()->AddLootDrop(
|
tradingWith->CastToNPC()->AddLootDrop(
|
||||||
item,
|
item,
|
||||||
&tradingWith->CastToNPC()->itemlist,
|
&tradingWith->CastToNPC()->itemlist,
|
||||||
LootDropEntries_Struct{.item_charges = static_cast<int8>(inst->GetCharges()), .equip_item = 1 },
|
new_loot_drop_entry,
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user