[9636] Move item real-time/in-game duration counting flag to new extraflags field.

Client expected only positive duration values, so stop use duration field as signed.
This commit is contained in:
VladimirMangos 2010-03-29 09:48:38 +04:00
parent 8e25d43443
commit d7c1e06d1b
11 changed files with 62 additions and 29 deletions

View file

@ -268,7 +268,7 @@ bool Item::Create( uint32 guidlow, uint32 itemid, Player const* owner)
SetSpellCharges(i,itemProto->Spells[i].SpellCharges);
SetUInt32Value(ITEM_FIELD_FLAGS, itemProto->Flags);
SetUInt32Value(ITEM_FIELD_DURATION, abs(itemProto->Duration));
SetUInt32Value(ITEM_FIELD_DURATION, itemProto->Duration);
return true;
}
@ -403,20 +403,20 @@ bool Item::LoadFromDB(uint32 guid, uint64 owner_guid, QueryResult *result)
}
// update duration if need, and remove if not need
if((proto->Duration==0) != (GetUInt32Value(ITEM_FIELD_DURATION)==0))
if ((proto->Duration == 0) != (GetUInt32Value(ITEM_FIELD_DURATION) == 0))
{
SetUInt32Value(ITEM_FIELD_DURATION,abs(proto->Duration));
SetUInt32Value(ITEM_FIELD_DURATION, proto->Duration);
need_save = true;
}
// set correct owner
if(owner_guid != 0 && GetOwnerGUID() != owner_guid)
if (owner_guid != 0 && GetOwnerGUID() != owner_guid)
{
SetOwnerGUID(owner_guid);
need_save = true;
}
if(need_save) // normal item changed state set not work at loading
if (need_save) // normal item changed state set not work at loading
{
std::ostringstream ss;
ss << "UPDATE item_instance SET data = '";