diff options
| author | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-08-02 14:41:33 +0200 |
|---|---|---|
| committer | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-08-02 14:41:33 +0200 |
| commit | 39cce3344c43d183ac855d9acfad83341d4d6335 (patch) | |
| tree | 44d1db22be5750026ab3b835bec56236cda5abf1 /src/server/game | |
| parent | 5b0cd048103e8ebf9620be06a30d1bcf0e901dd6 (diff) | |
| parent | 5ae86ee2a85923ed09b8b719ef98de759d22e0e8 (diff) | |
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts:
src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp
Diffstat (limited to 'src/server/game')
| -rw-r--r-- | src/server/game/Accounts/RBAC.h | 2 | ||||
| -rw-r--r-- | src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp | 10 | ||||
| -rw-r--r-- | src/server/game/Chat/Chat.cpp | 2 | ||||
| -rw-r--r-- | src/server/game/Globals/ObjectMgr.cpp | 1 | ||||
| -rw-r--r-- | src/server/game/Handlers/GroupHandler.cpp | 39 | ||||
| -rw-r--r-- | src/server/game/Loot/LootMgr.cpp | 2 | ||||
| -rw-r--r-- | src/server/game/OutdoorPvP/OutdoorPvP.cpp | 6 | ||||
| -rw-r--r-- | src/server/game/Spells/Spell.cpp | 1 | ||||
| -rw-r--r-- | src/server/game/Spells/SpellEffects.cpp | 39 |
9 files changed, 41 insertions, 61 deletions
diff --git a/src/server/game/Accounts/RBAC.h b/src/server/game/Accounts/RBAC.h index 35024fc4152..b97ea196a0a 100644 --- a/src/server/game/Accounts/RBAC.h +++ b/src/server/game/Accounts/RBAC.h @@ -119,6 +119,8 @@ class RBACObject RBACObject(uint32 id = 0, std::string const& name = ""):
_id(id), _name(name) { }
+ virtual ~RBACObject() { }
+
/// Gets the Name of the Object
std::string const& GetName() const { return _name; }
/// Gets the Id of the Object
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp index bef0e995988..2114fc4ef66 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp @@ -359,21 +359,19 @@ void BattlegroundAB::_NodeOccupied(uint8 node, Team team) if (!AddSpiritGuide(node, BG_AB_SpiritGuidePos[node][0], BG_AB_SpiritGuidePos[node][1], BG_AB_SpiritGuidePos[node][2], BG_AB_SpiritGuidePos[node][3], team)) TC_LOG_ERROR(LOG_FILTER_BATTLEGROUND, "Failed to spawn spirit guide! point: %u, team: %u, ", node, team); + if (node >= BG_AB_DYNAMIC_NODES_COUNT)//only dynamic nodes, no start points + return; + uint8 capturedNodes = 0; for (uint8 i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i) - { - if (m_Nodes[node] == GetTeamIndexByTeamId(team) + BG_AB_NODE_TYPE_OCCUPIED && !m_NodeTimers[i]) + if (m_Nodes[i] == GetTeamIndexByTeamId(team) + BG_AB_NODE_TYPE_OCCUPIED && !m_NodeTimers[i]) ++capturedNodes; - } if (capturedNodes >= 5) CastSpellOnTeam(SPELL_AB_QUEST_REWARD_5_BASES, team); if (capturedNodes >= 4) CastSpellOnTeam(SPELL_AB_QUEST_REWARD_4_BASES, team); - if (node >= BG_AB_DYNAMIC_NODES_COUNT)//only dynamic nodes, no start points - return; - Creature* trigger = BgCreatures[node+7] ? GetBGCreature(node+7) : NULL;//0-6 spirit guides if (!trigger) trigger = AddCreature(WORLD_TRIGGER, node+7, team, BG_AB_NodePositions[node][0], BG_AB_NodePositions[node][1], BG_AB_NodePositions[node][2], BG_AB_NodePositions[node][3]); diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index 1515c75597f..505d00dc5f6 100644 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -80,8 +80,8 @@ ChatCommand* ChatHandler::getCommandTable() // cache top-level commands size_t added = 0; commandTableCache = (ChatCommand*)malloc(sizeof(ChatCommand) * total); + ASSERT(commandTableCache); memset(commandTableCache, 0, sizeof(ChatCommand) * total); - ACE_ASSERT(commandTableCache); for (std::vector<ChatCommand*>::const_iterator it = dynamic.begin(); it != dynamic.end(); ++it) added += appendCommandTable(commandTableCache + added, *it); } diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 213d9eb74a3..c0fc7a7b681 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -6985,6 +6985,7 @@ void ObjectMgr::LoadPointsOfInterest() uint32 point_id = fields[0].GetUInt32(); PointOfInterest POI; + POI.entry = point_id; POI.x = fields[1].GetFloat(); POI.y = fields[2].GetFloat(); POI.icon = fields[3].GetUInt32(); diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index 7e6e1dedb4f..2f32b53fd0b 100644 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -943,33 +943,28 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player* player, WorldPacke if (mask & GROUP_UPDATE_FLAG_STATUS) { - if (player) - { - uint16 playerStatus = MEMBER_STATUS_ONLINE; - if (player->IsPvP()) - playerStatus |= MEMBER_STATUS_PVP; + uint16 playerStatus = MEMBER_STATUS_ONLINE; + if (player->IsPvP()) + playerStatus |= MEMBER_STATUS_PVP; - if (!player->IsAlive()) - { - if (player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST)) - playerStatus |= MEMBER_STATUS_GHOST; - else - playerStatus |= MEMBER_STATUS_DEAD; - } + if (!player->IsAlive()) + { + if (player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST)) + playerStatus |= MEMBER_STATUS_GHOST; + else + playerStatus |= MEMBER_STATUS_DEAD; + } - if (player->HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP)) - playerStatus |= MEMBER_STATUS_PVP_FFA; + if (player->HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP)) + playerStatus |= MEMBER_STATUS_PVP_FFA; - if (player->isAFK()) - playerStatus |= MEMBER_STATUS_AFK; + if (player->isAFK()) + playerStatus |= MEMBER_STATUS_AFK; - if (player->isDND()) - playerStatus |= MEMBER_STATUS_DND; + if (player->isDND()) + playerStatus |= MEMBER_STATUS_DND; - *data << uint16(playerStatus); - } - else - *data << uint16(MEMBER_STATUS_OFFLINE); + *data << uint16(playerStatus); } if (mask & GROUP_UPDATE_FLAG_CUR_HP) diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index ef914cc29ee..75655dca170 100644 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -417,7 +417,7 @@ void Loot::AddItem(LootStoreItem const& item) return; uint32 count = urand(item.mincountOrRef, item.maxcount); - uint32 stacks = count / proto->GetMaxStackSize() + (count % proto->GetMaxStackSize() ? 1 : 0); + uint32 stacks = count / proto->GetMaxStackSize() + ((count % proto->GetMaxStackSize()) ? 1 : 0); std::vector<LootItem>& lootItems = item.needs_quest ? quest_items : items; uint32 limit = item.needs_quest ? MAX_NR_QUEST_ITEMS : MAX_NR_LOOT_ITEMS; diff --git a/src/server/game/OutdoorPvP/OutdoorPvP.cpp b/src/server/game/OutdoorPvP/OutdoorPvP.cpp index 30308c12630..73b5399fa89 100644 --- a/src/server/game/OutdoorPvP/OutdoorPvP.cpp +++ b/src/server/game/OutdoorPvP/OutdoorPvP.cpp @@ -453,18 +453,14 @@ void OutdoorPvP::HandleKill(Player* killer, Unit* killed) // creature kills must be notified, even if not inside objective / not outdoor pvp active // player kills only count if active and inside objective if ((groupGuy->IsOutdoorPvPActive() && IsInsideObjective(groupGuy)) || killed->GetTypeId() == TYPEID_UNIT) - { HandleKillImpl(groupGuy, killed); - } } } else { // creature kills must be notified, even if not inside objective / not outdoor pvp active - if (killer && ((killer->IsOutdoorPvPActive() && IsInsideObjective(killer)) || killed->GetTypeId() == TYPEID_UNIT)) - { + if ((killer->IsOutdoorPvPActive() && IsInsideObjective(killer)) || killed->GetTypeId() == TYPEID_UNIT) HandleKillImpl(killer, killed); - } } } diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 9db018820ae..804a46a114c 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3123,6 +3123,7 @@ void Spell::cancel() CancelGlobalCooldown(); if (m_caster->GetTypeId() == TYPEID_PLAYER) m_caster->ToPlayer()->RestoreSpellMods(this); + // no break case SPELL_STATE_DELAYED: SendInterrupted(0); SendCastResult(SPELL_FAILED_INTERRUPTED); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index a0c83a441d3..54a6116fb04 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -3923,6 +3923,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) m_caster->CastSpell(unitTarget, spellId2, true); return; } + break; } case SPELLFAMILY_DEATHKNIGHT: { @@ -4372,25 +4373,11 @@ void Spell::EffectSummonObject(SpellEffIndex effIndex) return; uint32 go_id = m_spellInfo->Effects[effIndex].MiscValue; + uint8 slot = m_spellInfo->Effects[effIndex].Effect - SPELL_EFFECT_SUMMON_OBJECT_SLOT1; - uint8 slot = 0; - switch (m_spellInfo->Effects[effIndex].Effect) - { - case SPELL_EFFECT_SUMMON_OBJECT_SLOT1: slot = 0; break; - case SPELL_EFFECT_SUMMON_OBJECT_SLOT2: slot = 1; break; - case SPELL_EFFECT_SUMMON_OBJECT_SLOT3: slot = 2; break; - case SPELL_EFFECT_SUMMON_OBJECT_SLOT4: slot = 3; break; - default: return; - } - - uint64 guid = m_caster->m_ObjectSlot[slot]; - if (guid != 0) + if (uint64 guid = m_caster->m_ObjectSlot[slot]) { - GameObject* obj = NULL; - if (m_caster) - obj = m_caster->GetMap()->GetGameObject(guid); - - if (obj) + if (GameObject* obj = m_caster->GetMap()->GetGameObject(guid)) { // Recast case - null spell id to make auras not be removed on object remove from world if (m_spellInfo->Id == obj->GetSpellId()) @@ -4400,7 +4387,7 @@ void Spell::EffectSummonObject(SpellEffIndex effIndex) m_caster->m_ObjectSlot[slot] = 0; } - GameObject* pGameObj = new GameObject; + GameObject* go = new GameObject(); float x, y, z; // If dest location if present @@ -4411,24 +4398,24 @@ void Spell::EffectSummonObject(SpellEffIndex effIndex) m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE); Map* map = m_caster->GetMap(); - if (!pGameObj->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT), go_id, map, + if (!go->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT), go_id, map, m_caster->GetPhaseMask(), x, y, z, m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 0, GO_STATE_READY)) { - delete pGameObj; + delete go; return; } //pGameObj->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->getLevel()); int32 duration = m_spellInfo->GetDuration(); - pGameObj->SetRespawnTime(duration > 0 ? duration/IN_MILLISECONDS : 0); - pGameObj->SetSpellId(m_spellInfo->Id); - m_caster->AddGameObject(pGameObj); + go->SetRespawnTime(duration > 0 ? duration/IN_MILLISECONDS : 0); + go->SetSpellId(m_spellInfo->Id); + m_caster->AddGameObject(go); - ExecuteLogEffectSummonObject(effIndex, pGameObj); + ExecuteLogEffectSummonObject(effIndex, go); - map->AddToMap(pGameObj); + map->AddToMap(go); - m_caster->m_ObjectSlot[slot] = pGameObj->GetGUID(); + m_caster->m_ObjectSlot[slot] = go->GetGUID(); } void Spell::EffectResurrect(SpellEffIndex effIndex) |
