diff options
-rw-r--r-- | src/game/Map.cpp | 5 | ||||
-rw-r--r-- | src/game/Pet.cpp | 3 | ||||
-rw-r--r-- | src/game/Player.cpp | 30 | ||||
-rw-r--r-- | src/game/SpellEffects.cpp | 2 |
4 files changed, 10 insertions, 30 deletions
diff --git a/src/game/Map.cpp b/src/game/Map.cpp index 2ecb350beb5..c2acd65e72e 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -438,19 +438,20 @@ Map::LoadGrid(const Cell& cell, bool no_unload) { ObjectGridLoader loader(*grid, this, cell); loader.LoadN(); + setGridObjectDataLoaded(true,cell.GridX(), cell.GridY()); // Add resurrectable corpses to world object list in grid ObjectAccessor::Instance().AddCorpsesToGrid(GridPair(cell.GridX(),cell.GridY()),(*grid)(cell.CellX(), cell.CellY()), this); - setGridObjectDataLoaded(true,cell.GridX(), cell.GridY()); // Not sure if this is the reason that far sight cause crash // Seems crash happens when trying to delete a far sight dynobj from an unopened grid ResetGridExpiry(*getNGrid(cell.GridX(), cell.GridY()), 1.0f); grid->SetGridState(GRID_STATE_ACTIVE); + if(no_unload) getNGrid(cell.GridX(), cell.GridY())->setUnloadFlag(false); } - LoadVMap(63-cell.GridX(),63-cell.GridY()); + //LoadVMap(63-cell.GridX(),63-cell.GridY()); } bool Map::Add(Player *player) diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp index 59a6f596c72..504b78a5aa6 100644 --- a/src/game/Pet.cpp +++ b/src/game/Pet.cpp @@ -1767,6 +1767,9 @@ void Pet::LearnPetPassives() PetFamilySpellsStore::const_iterator petStore = sPetFamilySpellsStore.find(cFamily->ID); if(petStore != sPetFamilySpellsStore.end()) { + // For general hunter pets skill 270 + // Passive 01~10, Passive 00 (20782, not used), Ferocious Inspiration (34457) + // Scale 01~03 (34902~34904, bonus from owner, not used) for(PetFamilySpellsSet::const_iterator petSet = petStore->second.begin(); petSet != petStore->second.end(); ++petSet) addSpell(*petSet, ACT_DECIDE, PETSPELL_NEW, 0xffff, PETSPELL_FAMILY); } diff --git a/src/game/Player.cpp b/src/game/Player.cpp index e3e98805ceb..9bbd48e1862 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -16686,33 +16686,14 @@ void Player::SetRestBonus (float rest_bonus_new) void Player::HandleStealthedUnitsDetection() { std::list<Unit*> stealthedUnits; - - CellPair p(Trinity::ComputeCellPair(GetPositionX(),GetPositionY())); - Cell cell(p); - cell.data.Part.reserved = ALL_DISTRICT; - cell.SetNoCreate(); - Trinity::AnyStealthedCheck u_check; Trinity::UnitListSearcher<Trinity::AnyStealthedCheck > searcher(stealthedUnits, u_check); + VisitNearbyObject(World::GetMaxVisibleDistance(), searcher); - TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyStealthedCheck >, WorldTypeMapContainer > world_unit_searcher(searcher); - TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyStealthedCheck >, GridTypeMapContainer > grid_unit_searcher(searcher); - - CellLock<GridReadGuard> cell_lock(cell, p); - cell_lock->Visit(cell_lock, world_unit_searcher, *MapManager::Instance().GetMap(GetMapId(), this)); - cell_lock->Visit(cell_lock, grid_unit_searcher, *MapManager::Instance().GetMap(GetMapId(), this)); - - for (std::list<Unit*>::iterator i = stealthedUnits.begin(); i != stealthedUnits.end();) + for (std::list<Unit*>::iterator i = stealthedUnits.begin(); i != stealthedUnits.end(); ++i) { - if((*i)==this) - { - i = stealthedUnits.erase(i); - continue; - } - - if ((*i)->isVisibleForOrDetect(this,true)) + if (!HaveAtClient(*i) && canSeeOrDetect(*i, true)) { - (*i)->SendUpdateToPlayer(this); m_clientGUIDs.insert((*i)->GetGUID()); @@ -16734,12 +16715,7 @@ void Player::HandleStealthedUnitsDetection() ((Unit*)(*i))->SendAttackStart(((Unit*)(*i))->getVictim()); } } - - i = stealthedUnits.erase(i); - continue; } - - ++i; } } diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index a11fa495d00..f53338b023d 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -3469,7 +3469,7 @@ void Spell::EffectAddFarsight(uint32 i) CellPair pair = Trinity::ComputeCellPair(dynObj->GetPositionX(), dynObj->GetPositionY()); Cell cell(pair); Map* map = dynObj->GetMap(); - map->LoadGrid(cell); // In case the spell is casted into a different grid by player + map->EnsureGridLoadedForPlayer(cell, NULL, false); // In case the spell is casted into a different grid by player map->Add(dynObj); map->SwitchGridContainers(dynObj, true); // Needed for forwarding player packets dynObj->setActive(true); // Keep the grid updated even if there are no players in it |