mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 22:01:30 +00:00
Fix nullptr and item_slot check
This commit is contained in:
parent
e38268230f
commit
1024e327b5
@ -391,6 +391,8 @@ public:
|
|||||||
void SetActivated(bool activated) { m_activated = activated; }
|
void SetActivated(bool activated) { m_activated = activated; }
|
||||||
int8 GetEvolveLvl() const { return m_evolveLvl; }
|
int8 GetEvolveLvl() const { return m_evolveLvl; }
|
||||||
void SetScaling(bool v) { m_scaling = v; }
|
void SetScaling(bool v) { m_scaling = v; }
|
||||||
|
void SetTimestamp(uint32 v) { m_timestamp = v; }
|
||||||
|
uint32 GetTimestamp() { return m_timestamp; }
|
||||||
|
|
||||||
void Initialize(SharedDatabase *db = nullptr);
|
void Initialize(SharedDatabase *db = nullptr);
|
||||||
void ScaleItem();
|
void ScaleItem();
|
||||||
@ -435,6 +437,7 @@ protected:
|
|||||||
Item_Struct* m_scaledItem;
|
Item_Struct* m_scaledItem;
|
||||||
EvolveInfo* m_evolveInfo;
|
EvolveInfo* m_evolveInfo;
|
||||||
bool m_scaling;
|
bool m_scaling;
|
||||||
|
uint32 m_timestamp; // UNIX timestamp (GMT) of expiration
|
||||||
|
|
||||||
//
|
//
|
||||||
// Items inside of this item (augs or contents);
|
// Items inside of this item (augs or contents);
|
||||||
|
|||||||
@ -485,9 +485,9 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// This needs a bit more work for saving timer to PP for zoning etc
|
// This needs a bit more work for saving timer to PP for zoning etc
|
||||||
if (IsClient() && item_slot) {
|
if (IsClient() && item_slot != INVALID_INDEX) {
|
||||||
ItemInst *itm = CastToClient()->GetInv().GetItem(item_slot);
|
ItemInst *itm = CastToClient()->GetInv().GetItem(item_slot);
|
||||||
if (itm->GetItem()->RecastDelay) {
|
if (itm && itm->GetItem()->RecastDelay) {
|
||||||
outapp = new EQApplicationPacket(OP_ItemRecastDelay, sizeof(ItemRecastDelay_Struct));
|
outapp = new EQApplicationPacket(OP_ItemRecastDelay, sizeof(ItemRecastDelay_Struct));
|
||||||
ItemRecastDelay_Struct *ird = (ItemRecastDelay_Struct *)outapp->pBuffer;
|
ItemRecastDelay_Struct *ird = (ItemRecastDelay_Struct *)outapp->pBuffer;
|
||||||
ird->recast_delay = itm->GetItem()->RecastDelay;
|
ird->recast_delay = itm->GetItem()->RecastDelay;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user