[10072] More methods for access/modify ObjectGuid update fields.

* Some related cleanups.
* Also drop unused Player::SetFarSightGUID decalration as reported by LordJZ.
This commit is contained in:
VladimirMangos 2010-06-17 05:58:05 +04:00
parent 523584766b
commit 33d73f2efc
4 changed files with 11 additions and 9 deletions

View file

@ -1294,10 +1294,10 @@ void WorldSession::HandleFarSightOpcode( WorldPacket & recv_data )
//WorldPacket data(SMSG_CLEAR_FAR_SIGHT_IMMEDIATE, 0)
//SendPacket(&data);
//_player->SetUInt64Value(PLAYER_FARSIGHT, 0);
DEBUG_LOG("Removed FarSight from player %u", _player->GetGUIDLow());
DEBUG_LOG("Removed FarSight from %s", _player->GetObjectGuid().GetString().c_str());
break;
case 1:
DEBUG_LOG("Added FarSight (GUID:%u TypeId:%u) to player %u", GUID_LOPART(_player->GetFarSight()), GuidHigh2TypeId(GUID_HIPART(_player->GetFarSight())), _player->GetGUIDLow());
DEBUG_LOG("Added FarSight %s to %s", _player->GetFarSightGuid().GetString().c_str(), _player->GetObjectGuid().GetString().c_str());
break;
}
}

View file

@ -108,11 +108,11 @@ class MANGOS_DLL_SPEC Object
m_inWorld = false;
}
ObjectGuid const& GetObjectGuid() const { return *reinterpret_cast<ObjectGuid const*>(&GetUInt64Value(0)); }
const uint64& GetGUID() const { return GetUInt64Value(0); }
uint32 GetGUIDLow() const { return GUID_LOPART(GetUInt64Value(0)); }
ObjectGuid const& GetObjectGuid() const { return GetGuidValue(OBJECT_FIELD_GUID); }
const uint64& GetGUID() const { return GetUInt64Value(OBJECT_FIELD_GUID); }
uint32 GetGUIDLow() const { return GUID_LOPART(GetUInt64Value(OBJECT_FIELD_GUID)); }
PackedGuid const& GetPackGUID() const { return m_PackGUID; }
uint32 GetEntry() const { return GetUInt32Value(OBJECT_FIELD_ENTRY); }
void SetEntry(uint32 entry) { SetUInt32Value(OBJECT_FIELD_ENTRY, entry); }
@ -171,6 +171,8 @@ class MANGOS_DLL_SPEC Object
return *(((uint16*)&m_uint32Values[ index ])+offset);
}
ObjectGuid const& GetGuidValue( uint16 index ) const { return *reinterpret_cast<ObjectGuid const*>(&GetUInt64Value(index)); }
void SetInt32Value( uint16 index, int32 value );
void SetUInt32Value( uint16 index, uint32 value );
void SetUInt64Value( uint16 index, const uint64 &value );
@ -178,6 +180,7 @@ class MANGOS_DLL_SPEC Object
void SetByteValue( uint16 index, uint8 offset, uint8 value );
void SetUInt16Value( uint16 index, uint8 offset, uint16 value );
void SetInt16Value( uint16 index, uint8 offset, int16 value ) { SetUInt16Value(index,offset,(uint16)value); }
void SetGuidValue( uint16 index, ObjectGuid const& value ) { SetUInt64Value(index, value.GetRawValue()); }
void SetStatFloatValue( uint16 index, float value);
void SetStatInt32Value( uint16 index, int32 value);

View file

@ -2216,8 +2216,7 @@ class MANGOS_DLL_SPEC Player : public Unit
void EnterVehicle(Vehicle *vehicle);
void ExitVehicle(Vehicle *vehicle);
uint64 GetFarSight() const { return GetUInt64Value(PLAYER_FARSIGHT); }
void SetFarSightGUID(uint64 guid);
ObjectGuid const& GetFarSightGuid() const { return GetGuidValue(PLAYER_FARSIGHT); }
// Transports
Transport * GetTransport() const { return m_transport; }

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10071"
#define REVISION_NR "10072"
#endif // __REVISION_NR_H__