[7730] Some optimizantion and code style. Author: zhenya
--HG-- branch : trunk
This commit is contained in:
+3
-3
@@ -84,7 +84,7 @@ bool Bag::Create(uint32 guidlow, uint32 itemid, Player const* owner)
|
||||
SetUInt32Value(CONTAINER_FIELD_NUM_SLOTS, itemProto->ContainerSlots);
|
||||
|
||||
// Cleaning 20 slots
|
||||
for (uint8 i = 0; i < MAX_BAG_SIZE; i++)
|
||||
for (uint8 i = 0; i < MAX_BAG_SIZE; ++i)
|
||||
{
|
||||
SetUInt64Value(CONTAINER_FIELD_SLOT_1 + (i*2), 0);
|
||||
m_bagslot[i] = NULL;
|
||||
@@ -119,7 +119,7 @@ bool Bag::LoadFromDB(uint32 guid, uint64 owner_guid, QueryResult *result)
|
||||
|
||||
void Bag::DeleteFromDB()
|
||||
{
|
||||
for (int i = 0; i < MAX_BAG_SIZE; i++)
|
||||
for (int i = 0; i < MAX_BAG_SIZE; ++i)
|
||||
if (m_bagslot[i])
|
||||
m_bagslot[i]->DeleteFromDB();
|
||||
|
||||
@@ -129,7 +129,7 @@ void Bag::DeleteFromDB()
|
||||
uint32 Bag::GetFreeSlots() const
|
||||
{
|
||||
uint32 slots = 0;
|
||||
for (uint32 i=0; i < GetBagSize(); i++)
|
||||
for (uint32 i=0; i < GetBagSize(); ++i)
|
||||
if (!m_bagslot[i])
|
||||
++slots;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user