diff options
| author | kaelima <kaelima@live.se> | 2012-11-05 12:02:08 +0100 |
|---|---|---|
| committer | kaelima <kaelima@live.se> | 2012-11-05 12:02:08 +0100 |
| commit | 3c13454ad71b259c50d394a8a467a2570f683827 (patch) | |
| tree | 13b8744efdb5fc8930630f5e5c513f2727c7bb18 /src/server/game/Spells/Spell.cpp | |
| parent | 19d7f68592d653067c3b84c3d409e59b2724a85d (diff) | |
| parent | c5fdb02305c78d8193f8c3161449e3955d4f7e8a (diff) | |
Merge git://github.com/TrinityCore/TrinityCore into mmaps
Conflicts:
src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp
src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp
src/server/game/Movement/Spline/MoveSplineInit.cpp
Diffstat (limited to 'src/server/game/Spells/Spell.cpp')
| -rwxr-xr-x | src/server/game/Spells/Spell.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 45c4338f03d..77adece17b4 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4300,13 +4300,15 @@ void Spell::SendResurrectRequest(Player* target) { // get ressurector name for creature resurrections, otherwise packet will be not accepted // for player resurrections the name is looked up by guid - char const* resurrectorName = m_caster->GetTypeId() == TYPEID_PLAYER ? "" : m_caster->GetNameForLocaleIdx(target->GetSession()->GetSessionDbLocaleIndex()); + std::string const sentName(m_caster->GetTypeId() == TYPEID_PLAYER + ? "" + : m_caster->GetNameForLocaleIdx(target->GetSession()->GetSessionDbLocaleIndex())); - WorldPacket data(SMSG_RESURRECT_REQUEST, (8+4+strlen(resurrectorName)+1+1+1+4)); - data << uint64(m_caster->GetGUID()); // resurrector guid - data << uint32(strlen(resurrectorName) + 1); + WorldPacket data(SMSG_RESURRECT_REQUEST, (8+4+sentName.size()+1+1+1+4)); + data << uint64(m_caster->GetGUID()); + data << uint32(sentName.size() + 1); - data << resurrectorName; + data << sentName; data << uint8(0); // null terminator data << uint8(m_caster->GetTypeId() == TYPEID_PLAYER ? 0 : 1); // "you'll be afflicted with resurrection sickness" @@ -5865,7 +5867,7 @@ SpellCastResult Spell::CheckItems() else { uint32 itemid = m_CastItem->GetEntry(); - if (!p_caster->HasItemCount(itemid, 1)) + if (!p_caster->HasItemCount(itemid)) return SPELL_FAILED_ITEM_NOT_READY; ItemTemplate const* proto = m_CastItem->GetTemplate(); @@ -6017,7 +6019,7 @@ SpellCastResult Spell::CheckItems() { if (m_spellInfo->Totem[i] != 0) { - if (p_caster->HasItemCount(m_spellInfo->Totem[i], 1)) + if (p_caster->HasItemCount(m_spellInfo->Totem[i])) { totems -= 1; continue; @@ -6072,7 +6074,7 @@ SpellCastResult Spell::CheckItems() { if (!(m_spellInfo->SpellFamilyName == SPELLFAMILY_MAGE && (m_spellInfo->SpellFamilyFlags[0] & 0x40000000))) return SPELL_FAILED_TOO_MANY_OF_ITEM; - else if (!(p_caster->HasItemCount(m_spellInfo->Effects[i].ItemType, 1))) + else if (!(p_caster->HasItemCount(m_spellInfo->Effects[i].ItemType))) return SPELL_FAILED_TOO_MANY_OF_ITEM; else p_caster->CastSpell(m_caster, m_spellInfo->Effects[EFFECT_1].CalcValue(), false); // move this to anywhere @@ -6251,7 +6253,7 @@ SpellCastResult Spell::CheckItems() case ITEM_SUBCLASS_WEAPON_THROWN: { uint32 ammo = pItem->GetEntry(); - if (!m_caster->ToPlayer()->HasItemCount(ammo, 1)) + if (!m_caster->ToPlayer()->HasItemCount(ammo)) return SPELL_FAILED_NO_AMMO; }; break; @@ -6292,7 +6294,7 @@ SpellCastResult Spell::CheckItems() return SPELL_FAILED_NO_AMMO; } - if (!m_caster->ToPlayer()->HasItemCount(ammo, 1)) + if (!m_caster->ToPlayer()->HasItemCount(ammo)) { m_caster->ToPlayer()->SetUInt32Value(PLAYER_AMMO_ID, 0); return SPELL_FAILED_NO_AMMO; |
