aboutsummaryrefslogtreecommitdiff
path: root/src/game/Bag.cpp
diff options
context:
space:
mode:
authorSpp <none@none>2010-04-07 22:59:46 +0200
committerSpp <none@none>2010-04-07 22:59:46 +0200
commit49d05ba9aa1cd5c1f3ae96546283e6d03a037ff7 (patch)
treef7e6135573366a686c1f527e16a0a7d42a7877ff /src/game/Bag.cpp
parentd19e12708001fbef2308be0e8cb5375a2ac7af48 (diff)
Code style (game + scripts only):
"( " --> "(" " )" --> ")" --HG-- branch : trunk
Diffstat (limited to 'src/game/Bag.cpp')
-rw-r--r--src/game/Bag.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/game/Bag.cpp b/src/game/Bag.cpp
index c56e0c71007..aa78126b198 100644
--- a/src/game/Bag.cpp
+++ b/src/game/Bag.cpp
@@ -26,7 +26,7 @@
#include "Log.h"
#include "UpdateData.h"
-Bag::Bag( ): Item()
+Bag::Bag(): Item()
{
m_objectType |= TYPEMASK_CONTAINER;
m_objectTypeId = TYPEID_CONTAINER;
@@ -77,7 +77,7 @@ bool Bag::Create(uint32 guidlow, uint32 itemid, Player const* owner)
if (!itemProto || itemProto->ContainerSlots > MAX_BAG_SIZE)
return false;
- Object::_Create( guidlow, 0, HIGHGUID_CONTAINER );
+ Object::_Create(guidlow, 0, HIGHGUID_CONTAINER);
SetEntry(itemid);
SetFloatValue(OBJECT_FIELD_SCALE_X, 1.0f);
@@ -146,7 +146,7 @@ uint32 Bag::GetFreeSlots() const
return slots;
}
-void Bag::RemoveItem( uint8 slot, bool /*update*/ )
+void Bag::RemoveItem(uint8 slot, bool /*update*/)
{
assert(slot < MAX_BAG_SIZE);
@@ -154,7 +154,7 @@ void Bag::RemoveItem( uint8 slot, bool /*update*/ )
m_bagslot[slot]->SetContainer(NULL);
m_bagslot[slot] = NULL;
- SetUInt64Value( CONTAINER_FIELD_SLOT_1 + (slot * 2), 0 );
+ SetUInt64Value(CONTAINER_FIELD_SLOT_1 + (slot * 2), 0);
}
void Bag::StoreItem(uint8 slot, Item *pItem, bool /*update*/)
@@ -166,19 +166,19 @@ void Bag::StoreItem(uint8 slot, Item *pItem, bool /*update*/)
m_bagslot[slot] = pItem;
SetUInt64Value(CONTAINER_FIELD_SLOT_1 + (slot * 2), pItem->GetGUID());
pItem->SetUInt64Value(ITEM_FIELD_CONTAINED, GetGUID());
- pItem->SetUInt64Value( ITEM_FIELD_OWNER, GetOwnerGUID() );
+ pItem->SetUInt64Value(ITEM_FIELD_OWNER, GetOwnerGUID());
pItem->SetContainer(this);
pItem->SetSlot(slot);
}
}
-void Bag::BuildCreateUpdateBlockForPlayer( UpdateData *data, Player *target ) const
+void Bag::BuildCreateUpdateBlockForPlayer(UpdateData *data, Player *target) const
{
- Item::BuildCreateUpdateBlockForPlayer( data, target );
+ Item::BuildCreateUpdateBlockForPlayer(data, target);
for (uint32 i = 0; i < GetBagSize(); ++i)
if (m_bagslot[i])
- m_bagslot[i]->BuildCreateUpdateBlockForPlayer( data, target );
+ m_bagslot[i]->BuildCreateUpdateBlockForPlayer(data, target);
}
// If the bag is empty returns true
@@ -191,14 +191,14 @@ bool Bag::IsEmpty() const
return true;
}
-uint32 Bag::GetItemCount( uint32 item, Item* eItem ) const
+uint32 Bag::GetItemCount(uint32 item, Item* eItem) const
{
Item *pItem;
uint32 count = 0;
for (uint32 i=0; i < GetBagSize(); ++i)
{
pItem = m_bagslot[i];
- if ( pItem && pItem != eItem && pItem->GetEntry() == item )
+ if (pItem && pItem != eItem && pItem->GetEntry() == item)
count += pItem->GetCount();
}
@@ -207,7 +207,7 @@ uint32 Bag::GetItemCount( uint32 item, Item* eItem ) const
for (uint32 i=0; i < GetBagSize(); ++i)
{
pItem = m_bagslot[i];
- if ( pItem && pItem != eItem && pItem->GetProto()->Socket[0].Color )
+ if (pItem && pItem != eItem && pItem->GetProto()->Socket[0].Color)
count += pItem->GetGemCountWithID(item);
}
}
@@ -225,9 +225,9 @@ uint8 Bag::GetSlotByItemGUID(uint64 guid) const
return NULL_SLOT;
}
-Item* Bag::GetItemByPos( uint8 slot ) const
+Item* Bag::GetItemByPos(uint8 slot) const
{
- if ( slot < GetBagSize() )
+ if (slot < GetBagSize())
return m_bagslot[slot];
return NULL;