mirror of
https://github.com/mangosfour/server.git
synced 2025-12-25 22:37:04 +00:00
Merge remote branch 'origin/master' into 330
Conflicts: src/game/Unit.cpp
This commit is contained in:
commit
e73c5d3b79
177 changed files with 24212 additions and 2127 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue