diff options
author | megamage <none@none> | 2009-02-24 11:14:28 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-02-24 11:14:28 -0600 |
commit | 699bc588b86a5176fce0900804fb7d00425383fe (patch) | |
tree | 18dde44b0118d86bfeaf294f7917c7ff0310fbbd /src/game/InstanceSaveMgr.cpp | |
parent | 9d160c855fe950d96386165fe7f6e484b427b89d (diff) |
[7330] Code warnings and style cleanups. Some bugs fixes. Author: VladimirMangos
1) comparison singed and unsigned values
2) redundent includes
3) wrong constructor :-part field initilization
4) unused not-/*name*/-guarded args in template/virtual functions that not required like args.
5) explicitly list not implemented achievement types.
Also bugs fixed:
1) Drop wrong phase mask 0 check in WorldObject::InSamePhase.
2) ArenaTeamMember::ModifyPersonalRating incorrect work with move points in negative with infinity values in result.
3) ArenaTeam::SaveToDB code send uint64 value to string with arg format %u.
--HG--
branch : trunk
Diffstat (limited to 'src/game/InstanceSaveMgr.cpp')
-rw-r--r-- | src/game/InstanceSaveMgr.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/game/InstanceSaveMgr.cpp b/src/game/InstanceSaveMgr.cpp index b138c33d9a6..bd1b1c610a6 100644 --- a/src/game/InstanceSaveMgr.cpp +++ b/src/game/InstanceSaveMgr.cpp @@ -142,9 +142,8 @@ void InstanceSaveManager::RemoveInstanceSave(uint32 InstanceId) } } -InstanceSave::InstanceSave(uint16 MapId, uint32 InstanceId, uint8 difficulty, - time_t resetTime, bool canReset) -: m_mapid(MapId), m_instanceid(InstanceId), m_resetTime(resetTime), +InstanceSave::InstanceSave(uint16 MapId, uint32 InstanceId, uint8 difficulty, time_t resetTime, bool canReset) +: m_resetTime(resetTime), m_instanceid(InstanceId), m_mapid(MapId), m_difficulty(difficulty), m_canReset(canReset) { } @@ -375,14 +374,14 @@ void InstanceSaveManager::LoadResetTimes() // get the current reset times for normal instances (these may need to be updated) // these are only kept in memory for InstanceSaves that are loaded later // resettime = 0 in the DB for raid/heroic instances so those are skipped - typedef std::map<uint32, std::pair<uint32, uint64> > ResetTimeMapType; + typedef std::map<uint32, std::pair<uint32, time_t> > ResetTimeMapType; ResetTimeMapType InstResetTime; QueryResult *result = CharacterDatabase.Query("SELECT id, map, resettime FROM instance WHERE resettime > 0"); if( result ) { do { - if(uint64 resettime = (*result)[2].GetUInt64()) + if(time_t resettime = time_t((*result)[2].GetUInt64())) { uint32 id = (*result)[0].GetUInt32(); uint32 mapid = (*result)[1].GetUInt32(); @@ -400,11 +399,11 @@ void InstanceSaveManager::LoadResetTimes() { Field *fields = result->Fetch(); uint32 instance = fields[1].GetUInt32(); - uint64 resettime = fields[0].GetUInt64() + 2 * HOUR; + time_t resettime = time_t(fields[0].GetUInt64() + 2 * HOUR); ResetTimeMapType::iterator itr = InstResetTime.find(instance); if(itr != InstResetTime.end() && itr->second.second != resettime) { - CharacterDatabase.DirectPExecute("UPDATE instance SET resettime = '"I64FMTD"' WHERE id = '%u'", resettime, instance); + CharacterDatabase.DirectPExecute("UPDATE instance SET resettime = '"I64FMTD"' WHERE id = '%u'", uint64(resettime), instance); itr->second.second = resettime; } } |