diff options
| author | Nay <dnpd.dd@gmail.com> | 2013-08-25 14:12:32 +0100 |
|---|---|---|
| committer | Nay <dnpd.dd@gmail.com> | 2013-08-25 14:12:32 +0100 |
| commit | a7527b3b48ba864e923e5200b55879b48e552681 (patch) | |
| tree | 059602de88fae48ef5ef374e7159d11f09b249d1 /src/server/game | |
| parent | 0d44191a834d65f68f367ec26001cc2823b41f51 (diff) | |
| parent | ee3d3ab1ff5589036c41c236e4fc376f11854467 (diff) | |
Merge remote-tracking branch 'origin/master' into 4.3.4
Conflicts:
src/server/game/Spells/SpellMgr.cpp
src/server/scripts/Commands/cs_debug.cpp
src/server/scripts/EasternKingdoms/zone_redridge_mountains.cpp
src/tools/map_extractor/mpq_libmpq04.h
Diffstat (limited to 'src/server/game')
| -rw-r--r-- | src/server/game/Chat/Chat.cpp | 13 | ||||
| -rw-r--r-- | src/server/game/Entities/Object/Updates/UpdateMask.h | 2 | ||||
| -rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 8 | ||||
| -rw-r--r-- | src/server/game/Handlers/MiscHandler.cpp | 4 | ||||
| -rw-r--r-- | src/server/game/Instances/InstanceScript.h | 16 | ||||
| -rwxr-xr-x | src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp | 2 | ||||
| -rw-r--r-- | src/server/game/Spells/Auras/SpellAuras.cpp | 1 | ||||
| -rw-r--r-- | src/server/game/Spells/Spell.cpp | 1 | ||||
| -rw-r--r-- | src/server/game/Spells/SpellMgr.cpp | 17 | ||||
| -rw-r--r-- | src/server/game/World/World.cpp | 2 |
10 files changed, 41 insertions, 25 deletions
diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index 469a2b53b79..55440650993 100644 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -695,13 +695,12 @@ void ChatHandler::FillMessageData(WorldPacket* data, WorldSession* session, uint *data << uint32(0); // 2.1.0 *data << uint32(speaker->GetName().size() + 1); *data << speaker->GetName(); - uint64 listener_guid = 0; - *data << uint64(listener_guid); - if (listener_guid && !IS_PLAYER_GUID(listener_guid)) - { - *data << uint32(1); // string listener_name_length - *data << uint8(0); // string listener_name - } + *data << uint64(0); // listener_guid + //if (listener_guid && !IS_PLAYER_GUID(listener_guid)) + //{ + // *data << uint32(1); // string listener_name_length + // *data << uint8(0); // string listener_name + //} *data << uint32(messageLength); *data << message; *data << uint8(0); diff --git a/src/server/game/Entities/Object/Updates/UpdateMask.h b/src/server/game/Entities/Object/Updates/UpdateMask.h index 8be8dfecdaf..72c9e9945d0 100644 --- a/src/server/game/Entities/Object/Updates/UpdateMask.h +++ b/src/server/game/Entities/Object/Updates/UpdateMask.h @@ -36,7 +36,7 @@ class UpdateMask UpdateMask() : _fieldCount(0), _blockCount(0), _bits(NULL) { } - UpdateMask(UpdateMask const& right) + UpdateMask(UpdateMask const& right) : _bits(NULL) { SetCount(right.GetCount()); memcpy(_bits, right._bits, sizeof(uint8) * _blockCount * 32); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 3bfbc13c6c9..73f0d09cace 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -869,6 +869,8 @@ Player::Player(WorldSession* session): Unit(true), phaseMgr(this) m_WeeklyQuestChanged = false; + m_MonthlyQuestChanged = false; + m_SeasonalQuestChanged = false; SetPendingBind(0, 0); @@ -6849,10 +6851,8 @@ void Player::CheckAreaExploreAndOutdoor() } else if (diff > 5) { - int32 exploration_percent = (100-((diff-5)*5)); - if (exploration_percent > 100) - exploration_percent = 100; - else if (exploration_percent < 0) + int32 exploration_percent = 100 - ((diff - 5) * 5); + if (exploration_percent < 0) exploration_percent = 0; XP = uint32(sObjectMgr->GetBaseXP(areaEntry->area_level)*exploration_percent/100*sWorld->getRate(RATE_XP_EXPLORE)); diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 5ad39188fbd..dc3679e021f 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -1680,9 +1680,13 @@ void WorldSession::HandleRequestPetInfoOpcode(WorldPacket& /*recvData */) void WorldSession::HandleSetTaxiBenchmarkOpcode(WorldPacket& recvData) { + TC_LOG_DEBUG(LOG_FILTER_NETWORKIO, "WORLD: CMSG_SET_TAXI_BENCHMARK_MODE"); + uint8 mode; recvData >> mode; + mode ? _player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_TAXI_BENCHMARK) : _player->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_TAXI_BENCHMARK); + TC_LOG_DEBUG(LOG_FILTER_NETWORKIO, "Client used \"/timetest %d\" command", mode); } diff --git a/src/server/game/Instances/InstanceScript.h b/src/server/game/Instances/InstanceScript.h index 2d77f6792c6..44c149ba9ac 100644 --- a/src/server/game/Instances/InstanceScript.h +++ b/src/server/game/Instances/InstanceScript.h @@ -22,8 +22,6 @@ #include "ZoneScript.h" #include "World.h" #include "ObjectMgr.h" -//#include "GameObject.h" -//#include "Map.h" #define OUT_SAVE_INST_DATA TC_LOG_DEBUG(LOG_FILTER_TSCR, "Saving Instance Data for Instance %s (Map %d, Instance Id %d)", instance->GetMapName(), instance->GetId(), instance->GetInstanceId()) #define OUT_SAVE_INST_DATA_COMPLETE TC_LOG_DEBUG(LOG_FILTER_TSCR, "Saving Instance Data for Instance %s (Map %d, Instance Id %d) completed.", instance->GetMapName(), instance->GetId(), instance->GetInstanceId()) @@ -241,4 +239,16 @@ class InstanceScript : public ZoneScript MinionInfoMap minions; uint32 completedEncounters; // completed encounter mask, bit indexes are DungeonEncounter.dbc boss numbers, used for packets }; -#endif + +template<class AI, class T> +AI* GetInstanceAI(T* obj, char const* scriptName) +{ + if (InstanceMap* instance = obj->GetMap()->ToInstanceMap()) + if (instance->GetInstanceScript()) + if (instance->GetScriptId() == sObjectMgr->GetScriptId(scriptName)) + return new AI(obj); + + return NULL; +} + +#endif // TRINITY_INSTANCE_DATA_H diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp index 1e275b0be9f..31da239670b 100755 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp @@ -218,6 +218,8 @@ void FlightPathMovementGenerator::DoFinalize(Player* player) // when client side flight end early in comparison server side player->StopMoving(); } + + player->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_TAXI_BENCHMARK); } #define PLAYER_FLIGHT_SPEED 32.0f diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 4cb6fcc40e5..363446a72d3 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -2236,6 +2236,7 @@ void UnitAura::FillTargetMap(std::map<Unit*, uint8> & targets, Unit* caster) } case SPELL_EFFECT_APPLY_AREA_AURA_PET: targetList.push_back(GetUnitOwner()); + // no break case SPELL_EFFECT_APPLY_AREA_AURA_OWNER: { if (Unit* owner = GetUnitOwner()->GetCharmerOrOwner()) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 22da5257663..80349754585 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -6200,6 +6200,7 @@ SpellCastResult Spell::CheckItems() return SPELL_FAILED_DONT_REPORT; } } + // no break case SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC: { Item* targetItem = m_targets.GetItemTarget(); diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index cb0ba654b42..b34b935e975 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1224,7 +1224,7 @@ void SpellMgr::LoadSpellTalentRanks() node.rank = rank + 1; node.prev = prevSpell; - node.next = node.rank < MAX_TALENT_RANK ? GetSpellInfo(talentInfo->RankID[rank + 1]) : NULL; + node.next = node.rank < MAX_TALENT_RANK ? GetSpellInfo(talentInfo->RankID[node.rank]) : NULL; mSpellChains[spellId] = node; mSpellInfoMap[spellId]->ChainEntry = &mSpellChains[spellId]; @@ -2858,6 +2858,9 @@ void SpellMgr::LoadSpellInfoCustomAttributes() { uint32 enchantId = spellInfo->Effects[j].MiscValue; SpellItemEnchantmentEntry const* enchant = sSpellItemEnchantmentStore.LookupEntry(enchantId); + if (!enchant) + break; + for (uint8 s = 0; s < MAX_ITEM_ENCHANTMENT_EFFECTS; ++s) { if (enchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL) @@ -3386,10 +3389,6 @@ void SpellMgr::LoadSpellInfoCorrections() case 45602: // Ride Carpet spellInfo->Effects[EFFECT_0].BasePoints = 0; // force seat 0, vehicle doesn't have the required seat flags for "no seat specified (-1)" break; - case 59414: // Pulsing Shockwave Aura (Loken) - // this flag breaks movement, remove it - spellInfo->AttributesEx &= ~SPELL_ATTR1_CHANNELED_1; - break; case 61719: // Easter Lay Noblegarden Egg Aura - Interrupt flags copied from aura which this aura is linked with spellInfo->AuraInterruptFlags = AURA_INTERRUPT_FLAG_HITBYSPELL | AURA_INTERRUPT_FLAG_TAKE_DAMAGE; break; @@ -3785,10 +3784,10 @@ void SpellMgr::LoadSpellInfoCorrections() } } - SummonPropertiesEntry* properties = const_cast<SummonPropertiesEntry*>(sSummonPropertiesStore.LookupEntry(121)); - properties->Type = SUMMON_TYPE_TOTEM; - properties = const_cast<SummonPropertiesEntry*>(sSummonPropertiesStore.LookupEntry(647)); // 52893 - properties->Type = SUMMON_TYPE_TOTEM; + if (SummonPropertiesEntry* properties = const_cast<SummonPropertiesEntry*>(sSummonPropertiesStore.LookupEntry(121))) + properties->Type = SUMMON_TYPE_TOTEM; + if (SummonPropertiesEntry* properties = const_cast<SummonPropertiesEntry*>(sSummonPropertiesStore.LookupEntry(647))) // 52893 + properties->Type = SUMMON_TYPE_TOTEM; TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, ">> Loaded SpellInfo corrections in %u ms", GetMSTimeDiffToNow(oldMSTime)); } diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index f6001e2ac7a..b92698c7daa 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1141,7 +1141,7 @@ void World::LoadConfigSettings(bool reload) ///- Read the "Data" directory from the config file std::string dataPath = sConfigMgr->GetStringDefault("DataDir", "./"); - if (dataPath.at(dataPath.length()-1) != '/' && dataPath.at(dataPath.length()-1) != '\\') + if (dataPath.empty() || (dataPath.at(dataPath.length()-1) != '/' && dataPath.at(dataPath.length()-1) != '\\')) dataPath.push_back('/'); #if PLATFORM == PLATFORM_UNIX || PLATFORM == PLATFORM_APPLE |
