diff --git a/common/item_data.h b/common/item_data.h index d3ae5f928..e3123e22f 100644 --- a/common/item_data.h +++ b/common/item_data.h @@ -482,7 +482,7 @@ namespace EQ uint32 Haste; uint32 DamageShield; uint32 RecastDelay; - uint32 RecastType; + int RecastType; uint32 AugDistiller; bool Attuneable; bool NoPet; diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 18a2bed3d..18619ee6e 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -1118,7 +1118,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_ item.Haste = (uint32)atoul(row[ItemField::haste]); item.DamageShield = (uint32)atoul(row[ItemField::damageshield]); item.RecastDelay = (uint32)atoul(row[ItemField::recastdelay]); - item.RecastType = (uint32)atoul(row[ItemField::recasttype]); + item.RecastType = (int)atoi(row[ItemField::recasttype]); item.GuildFavor = (uint32)atoul(row[ItemField::guildfavor]); item.AugDistiller = (uint32)atoul(row[ItemField::augdistiller]); item.Attuneable = (atoi(row[ItemField::attuneable]) == 0) ? false : true; diff --git a/zone/spells.cpp b/zone/spells.cpp index f379dbc8c..36202f12c 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -1338,7 +1338,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo bool fromaug = false; EQ::ItemData* augitem = nullptr; uint32 recastdelay = 0; - uint32 recasttype = 0; + int recasttype = 0; while (true) { if (item == nullptr) @@ -1378,8 +1378,13 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo { //Can we start the timer here? I don't see why not. CastToClient()->GetPTimers().Start((pTimerItemStart + recasttype), recastdelay); - database.UpdateItemRecastTimestamps(CastToClient()->CharacterID(), recasttype, - CastToClient()->GetPTimers().Get(pTimerItemStart + recasttype)->GetReadyTimestamp()); + if (recasttype != -1) { + database.UpdateItemRecastTimestamps( + CastToClient()->CharacterID(), + recasttype, + CastToClient()->GetPTimers().Get(pTimerItemStart + recasttype)->GetReadyTimestamp() + ); + } } } @@ -2539,9 +2544,13 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui if(itm && itm->GetItem()->RecastDelay > 0){ auto recast_type = itm->GetItem()->RecastType; CastToClient()->GetPTimers().Start((pTimerItemStart + recast_type), itm->GetItem()->RecastDelay); - database.UpdateItemRecastTimestamps( - CastToClient()->CharacterID(), recast_type, - CastToClient()->GetPTimers().Get(pTimerItemStart + recast_type)->GetReadyTimestamp()); + if (recast_type != -1) { + database.UpdateItemRecastTimestamps( + CastToClient()->CharacterID(), + recast_type, + CastToClient()->GetPTimers().Get(pTimerItemStart + recast_type)->GetReadyTimestamp() + ); + } auto outapp = new EQApplicationPacket(OP_ItemRecastDelay, sizeof(ItemRecastDelay_Struct)); ItemRecastDelay_Struct *ird = (ItemRecastDelay_Struct *)outapp->pBuffer; ird->recast_delay = itm->GetItem()->RecastDelay;