Core/Spells: Better solution for exploit check (Thanks to manuel)

Readd lost changes from char db type cleanup
This commit is contained in:
leak
2011-01-20 03:06:51 +01:00
parent f7af49291b
commit dd751242fc
4 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -17549,11 +17549,11 @@ void Player::_LoadBoundInstances(PreparedQueryResult result)
Field* fields = result->Fetch();
bool perm = fields[1].GetBool();
uint32 mapId = fields[2].GetUInt32();
uint32 mapId = fields[2].GetUInt16();
uint32 instanceId = fields[0].GetUInt32();
uint8 difficulty = fields[3].GetUInt8();
time_t resetTime = (time_t)fields[4].GetUInt64();
time_t resetTime = time_t(fields[4].GetUInt32());
// the resettime for normal instances is only saved when the InstanceSave is unloaded
// so the value read from the DB may be wrong here but only if the InstanceSave is loaded
// and in that case it is not used
+1 -1
View File
@@ -160,7 +160,7 @@ bool Group::LoadGroupFromDB(const uint32 &groupGuid, QueryResult result, bool lo
m_lootThreshold = ItemQualities(fields[3].GetUInt16());
for (uint8 i = 0; i < TARGETICONCOUNT; ++i)
m_targetIcons[i] = fields[4+i].GetUInt64();
m_targetIcons[i] = fields[4+i].GetUInt32();
m_groupType = GroupType(fields[12].GetUInt8());
if (m_groupType & GROUPTYPE_RAID)
+1 -1
View File
@@ -591,7 +591,7 @@ bool Guild::Member::LoadFromDB(Field* fields)
fields[21].GetUInt8(),
fields[22].GetUInt32(),
fields[23].GetUInt32());
m_logoutTime = fields[24].GetUInt64();
m_logoutTime = fields[24].GetUInt32();
if (!CheckStats())
return false;
+1 -1
View File
@@ -2705,7 +2705,7 @@ void Spell::SendLoot(uint64 guid, LootType loottype)
if (gameObjTarget)
{
// Players shouldn't be able to loot gameobjects that are currently despawned
if (gameObjTarget->GetRespawnTime() > 0 && !player->isGameMaster())
if (!gameObjTarget->isSpawned() && !player->isGameMaster())
{
sLog->outError("Possible hacking attempt: Player %s [guid: %u] tried to loot a gameobject [entry: %u id: %u] which is on respawn time without being in GM mode!",
player->GetName(), player->GetGUIDLow(), gameObjTarget->GetEntry(), gameObjTarget->GetGUIDLow());