diff --git a/src/framework/GameSystem/Grid.h b/src/framework/GameSystem/Grid.h index f5c11668b..f95f7f912 100644 --- a/src/framework/GameSystem/Grid.h +++ b/src/framework/GameSystem/Grid.h @@ -117,12 +117,8 @@ class MANGOS_DLL_DECL Grid return i_container.template remove(obj); } - uint32 SetLastUpdateTimeAndReturnDiff(uint32 newtime) - { - uint32 realdiff = getMSTimeDiff(m_LastUpdateTime,newtime); - m_LastUpdateTime = newtime; - return realdiff; - } + uint32 GetLastUpdateTime() const { return m_LastUpdateTime; } + void SetLastUpdateTime(uint32 newtime) { m_LastUpdateTime = newtime; } private: diff --git a/src/game/Map.cpp b/src/game/Map.cpp index 70e61357a..4501b24f5 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -563,7 +563,11 @@ void Map::Update(uint32 time_, uint32 diff) uint32 realdiff = diff; if (loaded(cell.gridPair()) ) - realdiff = (*getNGrid(cell.GridX(),cell.GridY()))(cell.CellX(),cell.CellY()).SetLastUpdateTimeAndReturnDiff(time_); + { + GridType& celldata = (*getNGrid(cell.GridX(), cell.GridY()))(cell.CellX(), cell.CellY()); + uint32 realdiff = getMSTimeDiff(celldata.GetLastUpdateTime(), time_); + celldata.SetLastUpdateTime(time_); + } MaNGOS::ObjectUpdater updater(realdiff, diff); // for creature @@ -622,7 +626,11 @@ void Map::Update(uint32 time_, uint32 diff) uint32 realdiff = diff; if (loaded(cell.gridPair()) ) - realdiff = (*getNGrid(cell.GridX(),cell.GridY()))(cell.CellX(),cell.CellY()).SetLastUpdateTimeAndReturnDiff(time_); + { + GridType& celldata = (*getNGrid(cell.GridX(), cell.GridY()))(cell.CellX(), cell.CellY()); + uint32 realdiff = getMSTimeDiff(celldata.GetLastUpdateTime(), time_); + celldata.SetLastUpdateTime(time_); + } MaNGOS::ObjectUpdater updater(realdiff, diff); // for creature diff --git a/src/game/ObjectGridLoader.cpp b/src/game/ObjectGridLoader.cpp index 37fbcb0ac..a3784c1fb 100644 --- a/src/game/ObjectGridLoader.cpp +++ b/src/game/ObjectGridLoader.cpp @@ -241,7 +241,7 @@ void ObjectGridLoader::LoadN(void) loader.Load(i_grid(x, y), *this); // setup last update time for loaded cell - i_grid(x, y).SetLastUpdateTimeAndReturnDiff(updatetime); + i_grid(x, y).SetLastUpdateTime(updatetime); } } DEBUG_LOG("%u GameObjects, %u Creatures, and %u Corpses/Bones loaded for grid %u on map %u", i_gameObjects, i_creatures, i_corpses,i_grid.GetGridId(), i_map->GetId()); diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 2477d9a3d..0c2368c6e 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -6061,7 +6061,7 @@ SpellCastResult Spell::CheckItems() if (item_prospectingskilllevel >p_caster->GetSkillValue(SKILL_JEWELCRAFTING)) return SPELL_FAILED_LOW_CASTLEVEL; // make sure the player has the required ores in inventory - if (m_targets.getItemTarget()->GetCount() < CalculateDamage(SpellEffectIndex(i), m_caster)) + if (int32(m_targets.getItemTarget()->GetCount()) < CalculateDamage(SpellEffectIndex(i), m_caster)) return SPELL_FAILED_NEED_MORE_ITEMS; if (!LootTemplates_Prospecting.HaveLootFor(m_targets.getItemTargetEntry())) @@ -6084,7 +6084,7 @@ SpellCastResult Spell::CheckItems() if (item_millingskilllevel >p_caster->GetSkillValue(SKILL_INSCRIPTION)) return SPELL_FAILED_LOW_CASTLEVEL; // make sure the player has the required herbs in inventory - if (m_targets.getItemTarget()->GetCount() < CalculateDamage(SpellEffectIndex(i), m_caster)) + if (int32(m_targets.getItemTarget()->GetCount()) < CalculateDamage(SpellEffectIndex(i), m_caster)) return SPELL_FAILED_NEED_MORE_ITEMS; if(!LootTemplates_Milling.HaveLootFor(m_targets.getItemTargetEntry())) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 79d832e88..f7ebb3dbb 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "10689" + #define REVISION_NR "10690" #endif // __REVISION_NR_H__