Core/DB: Fix character creation in Player::SaveToDB.
And some misc comments/whitespaces
This commit is contained in:
@@ -616,8 +616,8 @@ bool AuthSocket::_HandleLogonProof()
|
||||
memcpy(proof.M2, sha.GetDigest(), 20);
|
||||
proof.cmd = AUTH_LOGON_PROOF;
|
||||
proof.error = 0;
|
||||
proof.unk1 = 0x00800000;
|
||||
proof.unk2 = 0x00;
|
||||
proof.unk1 = 0x00800000; // Accountflags. 0x01 = GM, 0x08 = Trial, 0x00800000 = Pro pass (arena tournament)
|
||||
proof.unk2 = 0x00; // SurveyId
|
||||
proof.unk3 = 0x00;
|
||||
socket().send((char *)&proof, sizeof(proof));
|
||||
}
|
||||
|
||||
@@ -68,10 +68,12 @@ void SmartWaypointMgr::LoadFromDB()
|
||||
path = new WPPath;
|
||||
last_id = 1;
|
||||
}
|
||||
|
||||
if (last_id != id)
|
||||
{
|
||||
sLog->outErrorDb("SmartWaypointMgr::LoadFromDB: Path entry %u, unexpected point id %u, expected %u.", entry, id, last_id);
|
||||
}
|
||||
|
||||
last_id++;
|
||||
(*path)[id] = wp;
|
||||
|
||||
|
||||
@@ -280,7 +280,6 @@ bool IsDisabledFor(DisableType type, uint32 entry, Unit const* unit, uint8 flags
|
||||
uint8 spellFlags = itr->second.flags;
|
||||
if (unit)
|
||||
{
|
||||
|
||||
if ((spellFlags & SPELL_DISABLE_PLAYER && unit->GetTypeId() == TYPEID_PLAYER) ||
|
||||
(unit->GetTypeId() == TYPEID_UNIT && ((unit->ToCreature()->isPet() && spellFlags & SPELL_DISABLE_PET) || spellFlags & SPELL_DISABLE_CREATURE)))
|
||||
{
|
||||
@@ -311,6 +310,7 @@ bool IsDisabledFor(DisableType type, uint32 entry, Unit const* unit, uint8 flags
|
||||
}
|
||||
else if (spellFlags & SPELL_DISABLE_DEPRECATED_SPELL) // call not from spellcast
|
||||
return true;
|
||||
|
||||
break;
|
||||
}
|
||||
case DISABLE_TYPE_MAP:
|
||||
|
||||
@@ -3088,7 +3088,8 @@ void Player::GiveLevel(uint8 level)
|
||||
// Refer-A-Friend
|
||||
if (GetSession()->GetRecruiterId())
|
||||
if (level < sWorld->getIntConfig(CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL))
|
||||
if (level % 2 == 0) {
|
||||
if (level % 2 == 0)
|
||||
{
|
||||
++m_grantableLevels;
|
||||
|
||||
if (!HasByteFlag(PLAYER_FIELD_BYTES, 1, 0x01))
|
||||
@@ -18353,9 +18354,7 @@ void Player::SaveToDB(bool create /*=false*/)
|
||||
// cache equipment...
|
||||
for (uint32 i = 0; i < EQUIPMENT_SLOT_END * 2; ++i)
|
||||
ss << GetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + i) << ' ';
|
||||
stmt->setString(index++, ss.str());
|
||||
|
||||
ss.str().clear();
|
||||
// ...and bags for enum opcode
|
||||
for (uint32 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i)
|
||||
{
|
||||
@@ -18466,9 +18465,7 @@ void Player::SaveToDB(bool create /*=false*/)
|
||||
// cache equipment...
|
||||
for (uint32 i = 0; i < EQUIPMENT_SLOT_END * 2; ++i)
|
||||
ss << GetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + i) << ' ';
|
||||
stmt->setString(index++, ss.str());
|
||||
|
||||
ss.str().clear();
|
||||
// ...and bags for enum opcode
|
||||
for (uint32 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i)
|
||||
{
|
||||
@@ -22917,7 +22914,6 @@ bool Player::CanCaptureTowerPoint()
|
||||
}
|
||||
|
||||
uint32 Player::GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 newfacialhair, BarberShopStyleEntry const* newSkin)
|
||||
|
||||
{
|
||||
uint8 level = getLevel();
|
||||
|
||||
|
||||
@@ -774,7 +774,7 @@ enum PlayerChatTag
|
||||
CHAT_TAG_AFK = 0x01,
|
||||
CHAT_TAG_DND = 0x02,
|
||||
CHAT_TAG_GM = 0x04,
|
||||
CHAT_TAG_UNK = 0x08, // Probably battleground commentator
|
||||
CHAT_TAG_COM = 0x08, // Commentator
|
||||
CHAT_TAG_DEV = 0x10,
|
||||
};
|
||||
|
||||
@@ -2301,6 +2301,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
m_mover = target;
|
||||
m_mover->m_movedPlayer = this;
|
||||
}
|
||||
|
||||
void SetSeer(WorldObject* target) { m_seer = target; }
|
||||
void SetViewpoint(WorldObject* target, bool apply);
|
||||
WorldObject* GetViewpoint() const;
|
||||
|
||||
@@ -130,7 +130,7 @@ void PlayerSocial::SendSocialList(Player* player)
|
||||
sSocialMgr->GetFriendInfo(player, itr->first, itr->second);
|
||||
|
||||
data << uint64(itr->first); // player guid
|
||||
data << uint32(itr->second.Flags); // player flag (0x1-friend?, 0x2-ignored?, 0x4-muted?)
|
||||
data << uint32(itr->second.Flags); // player flag (0x1 = Friend, 0x2 = Ignored, 0x4 = Muted)
|
||||
data << itr->second.Note; // string note
|
||||
if (itr->second.Flags & SOCIAL_FLAG_FRIEND) // if IsFriend()
|
||||
{
|
||||
|
||||
@@ -212,6 +212,7 @@ void ObjectAccessor::RemoveCorpse(Corpse* corpse)
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
corpse->RemoveFromWorld();
|
||||
|
||||
// Critical section
|
||||
@@ -292,6 +293,7 @@ Corpse* ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool insignia
|
||||
|
||||
// remove corpse from player_guid -> corpse map and from current map
|
||||
RemoveCorpse(corpse);
|
||||
|
||||
// remove corpse from DB
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
corpse->DeleteFromDB(trans);
|
||||
|
||||
Reference in New Issue
Block a user