Merge remote branch 'origin/master' into 330

Conflicts:
	src/game/Unit.cpp
This commit is contained in:
tomrus88 2010-03-10 20:24:28 +03:00
commit e73c5d3b79
177 changed files with 24212 additions and 2127 deletions

View file

@ -19,7 +19,7 @@
#include "Common.h"
#include "Item.h"
#include "ObjectMgr.h"
#include "ObjectDefines.h"
#include "ObjectGuid.h"
#include "WorldPacket.h"
#include "Database/DatabaseEnv.h"
#include "ItemEnchantmentMgr.h"
@ -1055,3 +1055,28 @@ bool ItemRequiredTarget::IsFitToRequirements( Unit* pUnitTarget ) const
return false;
}
}
bool Item::HasMaxCharges() const
{
ItemPrototype const* itemProto = GetProto();
for(int i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)
if (GetSpellCharges(i) != itemProto->Spells[i].SpellCharges)
return false;
return true;
}
void Item::RestoreCharges()
{
ItemPrototype const* itemProto = GetProto();
for(int i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)
{
if (GetSpellCharges(i) != itemProto->Spells[i].SpellCharges)
{
SetSpellCharges(i, itemProto->Spells[i].SpellCharges);
SetState(ITEM_CHANGED);
}
}
}