[9635] Restore load/save shown action bars.

Signed-off-by: hunuza <hunuza@gmail.com>
This commit is contained in:
hunuza 2010-03-28 15:24:55 +02:00
parent d85e4228f1
commit 8e25d43443
8 changed files with 26 additions and 14 deletions

View file

@ -100,6 +100,9 @@ bool Corpse::Create( uint32 guidlow, Player *owner)
void Corpse::SaveToDB()
{
// bones should not be saved to DB (would be deleted on startup anyway)
assert(GetType() != CORPSE_BONES);
// prevent DB data inconsistence problems and duplicates
CharacterDatabase.BeginTransaction();
DeleteFromDB();
@ -137,12 +140,11 @@ void Corpse::DeleteBonesFromWorld()
void Corpse::DeleteFromDB()
{
if(GetType() == CORPSE_BONES)
// only specific bones
CharacterDatabase.PExecute("DELETE FROM corpse WHERE guid = '%d'", GetGUIDLow());
else
// all corpses (not bones)
CharacterDatabase.PExecute("DELETE FROM corpse WHERE player = '%d' AND corpse_type <> '0'", GUID_LOPART(GetOwnerGUID()));
// bones should not be saved to DB (would be deleted on startup anyway)
assert(GetType() != CORPSE_BONES);
// all corpses (not bones)
CharacterDatabase.PExecute("DELETE FROM corpse WHERE player = '%d' AND corpse_type <> '0'", GUID_LOPART(GetOwnerGUID()));
}
bool Corpse::LoadFromDB(uint32 guid, Field *fields)