Skip to content

Commit

Permalink
Fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
celguar committed Apr 15, 2024
1 parent dd7bf83 commit 414217b
Show file tree
Hide file tree
Showing 18 changed files with 8 additions and 137 deletions.
9 changes: 0 additions & 9 deletions src/game/BattleGround/BattleGround.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1523,15 +1523,6 @@ void BattleGround::OnObjectDBLoad(GameObject* obj)
}
}

uint32 BattleGround::GetSingleGameObjectGuid(uint8 event1, uint8 event2)
{
auto itr = m_eventObjects[MAKE_PAIR32(event1, event2)].gameobjects.begin();
if (itr != m_eventObjects[MAKE_PAIR32(event1, event2)].gameobjects.end())
return *itr;

return ObjectGuid();
}

/**
Function that checks if event handles doors
Expand Down
2 changes: 1 addition & 1 deletion src/game/Entities/CharacterHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
uint8 msg = pCurrChar->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemid, 1, &noSpaceForCount);
if (msg != EQUIP_ERR_OK)
{
ostringstream body;
std::ostringstream body;
body << "Hello, " << pCurrChar->GetName() << ",\n\n";
body << "Welcome to the World of Warcraft!\n\n";
body << "As special thanks for purchasing the World of Warcraft Collector's Edition we send you a gift: a little companion to join you on your quest for adventure and glory.\n\n";
Expand Down
1 change: 0 additions & 1 deletion src/game/Entities/Object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2492,7 +2492,6 @@ struct WorldObjectChangeAccumulator
{
#endif
if (owner != &i_object && owner->HasAtClient(&i_object))
#endif
i_object.BuildUpdateDataForPlayer(owner, i_updateDatas);
#ifdef ENABLE_PLAYERBOTS
}
Expand Down
59 changes: 0 additions & 59 deletions src/game/Entities/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1686,43 +1686,6 @@ void Player::Heartbeat()
SendUpdateToOutOfRangeGroupMembers();
}

#ifdef ENABLE_PLAYERBOTS
void Player::CreatePlayerbotAI()
{
assert(!m_playerbotAI);
m_playerbotAI = std::make_unique<PlayerbotAI>(this);
}

void Player::RemovePlayerbotAI()
{
m_playerbotAI = nullptr;
}

void Player::CreatePlayerbotMgr()
{
assert(!m_playerbotMgr);
m_playerbotMgr = std::make_unique<PlayerbotMgr>(this);
}

void Player::RemovePlayerbotMgr()
{
m_playerbotMgr = nullptr;
}

void Player::UpdateAI(const uint32 diff, bool minimal)
{
if (m_playerbotAI)
{
m_playerbotAI->UpdateAI(diff);
}

if (m_playerbotMgr)
{
m_playerbotMgr->UpdateAI(diff);
}
}
#endif

void Player::SetDeathState(DeathState s)
{
uint32 ressSpellId = 0;
Expand Down Expand Up @@ -8355,25 +8318,6 @@ Item* Player::GetItemByGuid(ObjectGuid guid) const
return nullptr;
}

Item* Player::GetItemByEntry(uint32 item) const
{
for (int i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; ++i)
if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i))
if (pItem->GetEntry() == item)
{
return pItem;
}

for (int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i)
if (Bag* pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i))
if (Item* itemPtr = pBag->GetItemByEntry(item))
{
return itemPtr;
}

return NULL;
}

Item* Player::GetItemByPos(uint16 pos) const
{
uint8 bag = pos >> 8;
Expand Down Expand Up @@ -12869,7 +12813,6 @@ void Player::RewardQuest(Quest const* pQuest, uint32 reward, Object* questGiver,
{
#endif
if (!handled && pQuest->GetQuestCompleteScript() != 0)
#endif
GetMap()->ScriptsStart(SCRIPT_TYPE_QUEST_END, pQuest->GetQuestCompleteScript(), questGiver, this, Map::SCRIPT_EXEC_PARAM_UNIQUE_BY_SOURCE);
#ifdef ENABLE_PLAYERBOTS
}
Expand Down Expand Up @@ -19910,8 +19853,6 @@ void Player::learnClassLevelSpells(bool includeHighLevelQuestRewards)
{
CastSpell(this, tSpell->spell, TRIGGERED_OLD_TRIGGERED);
}
else
CastSpell(this, tSpell->spell, TRIGGERED_OLD_TRIGGERED);
}
}
}
Expand Down
1 change: 0 additions & 1 deletion src/game/Entities/Player.h
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,6 @@ class Player : public Unit
Item* GetItemByEntry(uint32 item) const; // only for special cases
Item* GetItemByPos(uint16 pos) const;
Item* GetItemByPos(uint8 bag, uint8 slot) const;
Item* GetItemByEntry(uint32 item) const;

Item* GetWeaponForAttack(WeaponAttackType attackType) const { return GetWeaponForAttack(attackType, false, false); }
Item* GetWeaponForAttack(WeaponAttackType attackType, bool nonbroken, bool useable) const;
Expand Down
2 changes: 1 addition & 1 deletion src/game/Entities/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2675,7 +2675,7 @@ void Unit::DoExtraAttacks(Unit* pVictim)
swingError = SWING_ERROR_BAD_FACING;
else if (!pVictim->IsAlive())
swingError = SWING_ERROR_TARGET_NOT_ALIVE;
else if (!CanAttackInCombat(pVictim))
else if (!CanAttackInCombat(pVictim, false, false))
swingError = SWING_ERROR_CANT_ATTACK_TARGET;

if (swingError)
Expand Down
2 changes: 1 addition & 1 deletion src/game/LFG/LFGQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class LFGQueue

void LoadMeetingStones();
MeetingStoneSet GetDungeonsForPlayer(Player* player);
void TeleportGroupToStone(Group* grp, uint32 areaId);
void TeleportGroupToStone(uint32 groupId, uint32 areaId);
#endif

private:
Expand Down
2 changes: 1 addition & 1 deletion src/game/Loot/LootMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@ bool Loot::FillLoot(uint32 loot_id, LootStore const& store, Player* lootOwner, b

m_lootItems.reserve(MAX_NR_LOOT_ITEMS);

tab->Process(*this, lootOwner, store, store.IsRatesAllowed()); // Processing is done there, callback via Loot::AddItem()
tab->Process(*this, lootOwner, store.IsRatesAllowed()); // Processing is done there, callback via Loot::AddItem()
#ifdef ENABLE_MODULES
}
#endif
Expand Down
4 changes: 1 addition & 3 deletions src/game/Maps/Map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,6 @@ void Map::Update(const uint32& t_diff)
}
}
}
#endif

// Reset the has real players flag and check for it again
const bool hadRealPlayers = hasRealPlayers;
Expand Down Expand Up @@ -1089,7 +1088,7 @@ void Map::Update(const uint32& t_diff)
{
shouldUpdateBot = true;
}
}*/
}
}

// Save the active characters for later logs
Expand Down Expand Up @@ -1161,7 +1160,6 @@ void Map::Update(const uint32& t_diff)
}

const bool shouldUpdateObjects = urand(0, (uint32)(objectUpdateChance * 100)) < 100;
#endif

// non-player active objects
bool updateObj = urand(0, (HasRealPlayers() ? avgDiff : (avgDiff * 3))) < 10;
Expand Down
8 changes: 0 additions & 8 deletions src/game/Maps/Map.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,6 @@ class Map : public GridRefManager<NGridType>
void DoUpdate(uint32 maxDiff, uint32 minimumTimeSinceLastUpdate = 0);
virtual void Update(const uint32&);

#ifdef ENABLE_PLAYERBOTS
bool HasRealPlayers() { return hasRealPlayers; }
#endif

void MessageBroadcast(Player const*, WorldPacket const&, bool to_self);
void MessageBroadcast(WorldObject const*, WorldPacket const&);
void ThreatMessageBroadcast(WorldObject const*, std::string const&, bool newClient = false);
Expand Down Expand Up @@ -412,10 +408,6 @@ class Map : public GridRefManager<NGridType>

// debug
std::set<ObjectGuid> m_objRemoveList; // this will eventually eat up too much memory - only used for debugging VisibleNotifier::Notify() customlog leak

bool HasActiveAreas(ContinentArea areaId = MAP_NO_AREA) { if (areaId == MAP_NO_AREA) { return !m_activeAreas.empty(); } else { return !(find(m_activeAreas.begin(), m_activeAreas.end(), areaId) == m_activeAreas.end()); } }
bool HasActiveZones() { return !m_activeZones.empty(); }
bool HasActiveZone(uint32 zoneId) { return find(m_activeZones.begin(), m_activeZones.end(), zoneId) != m_activeZones.end(); }

#ifdef ENABLE_PLAYERBOTS
bool HasRealPlayers() { return hasRealPlayers; }
Expand Down
8 changes: 0 additions & 8 deletions src/game/MotionGenerators/MovementHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,14 +363,6 @@ void WorldSession::HandleMoveTeleportAckOpcode(WorldPacket& recv_data)
// honorless target
if (plMover->pvpInfo.inPvPEnforcedArea)
plMover->CastSpell(plMover, 2479, TRIGGERED_OLD_TRIGGERED);

#ifdef ENABLE_PLAYERBOTS
// reset moving for bot if any
if (plMover->GetPlayerbotAI() && !plMover->GetMotionMaster()->empty())
{
if (MovementGenerator* movgen = plMover->GetMotionMaster()->top())
movgen->Reset(*plMover);
}
#endif

m_anticheat->Teleport({ dest.coord_x, dest.coord_y, dest.coord_z, dest.orientation });
Expand Down
21 changes: 0 additions & 21 deletions src/game/MotionGenerators/PathFinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,6 @@

#include <limits>
////////////////// PathFinder //////////////////
PathFinder::PathFinder() :
m_polyLength(0), m_type(PATHFIND_BLANK),
m_useStraightPath(false), m_forceDestination(false), m_straightLine(false), m_pointPathLimit(MAX_POINT_PATH_LENGTH), // TODO: Fix legitimate long paths
m_sourceUnit(nullptr), m_navMesh(nullptr), m_navMeshQuery(nullptr), m_cachedPoints(m_pointPathLimit* VERTEX_SIZE), m_pathPolyRefs(m_pointPathLimit), m_smoothPathPolyRefs(m_pointPathLimit), m_defaultMapId(0)
{
//MMAP::MMapManager* mmap = MMAP::MMapFactory::createOrGetMMapManager();
//m_defaultNavMeshQuery = mmap->GetNavMeshQuery(mapId, instanceId);

//createFilter();
}

PathFinder::PathFinder(uint32 mapId, uint32 instanceId) :
m_polyLength(0), m_type(PATHFIND_BLANK),
m_useStraightPath(false), m_forceDestination(false), m_straightLine(false), m_pointPathLimit(MAX_POINT_PATH_LENGTH), // TODO: Fix legitimate long paths
m_sourceUnit(nullptr), m_navMesh(nullptr), m_navMeshQuery(nullptr), m_cachedPoints(m_pointPathLimit* VERTEX_SIZE), m_pathPolyRefs(m_pointPathLimit), m_smoothPathPolyRefs(m_pointPathLimit), m_defaultMapId(mapId)
{
MMAP::MMapManager* mmap = MMAP::MMapFactory::createOrGetMMapManager();
m_defaultNavMeshQuery = mmap->GetNavMeshQuery(mapId, instanceId);

createFilter();
}
PathFinder::PathFinder(const Unit* owner, bool ignoreNormalization) :
m_type(PATHFIND_BLANK), m_useStraightPath(false), m_forceDestination(false), m_straightLine(false),
m_pointPathLimit(MAX_POINT_PATH_LENGTH), // TODO: Fix legitimate long paths
Expand Down
2 changes: 0 additions & 2 deletions src/game/MotionGenerators/PathFinder.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ enum PathType
class PathFinder
{
public:
PathFinder();
PathFinder(uint32 mapId, uint32 instanceId = 0);
PathFinder(Unit const* owner, bool ignoreNormalization = false);
~PathFinder();

Expand Down
3 changes: 0 additions & 3 deletions src/game/Server/DBCfmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ const char CreatureTypefmt[] = "nxxxxxxxxxx";
const char DurabilityCostsfmt[] = "niiiiiiiiiiiiiiiiiiiiiiiiiiiii";
const char DurabilityQualityfmt[] = "nf";
const char EmotesEntryfmt[] = "nxxiiix";
#ifdef ENABLE_PLAYERBOTS
char const EmotesTextSoundEntryfmt[] = "niiii";
#endif
const char EmotesTextEntryfmt[] = "nxixxxxxxxxxxxxxxxx";

#ifdef ENABLE_PLAYERBOTS
Expand Down
14 changes: 1 addition & 13 deletions src/game/Server/WorldSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ void WorldSession::SendPacket(WorldPacket const& packet, bool forcedSend /*= fal
}
#endif

if (!m_Socket || (m_sessionState != WORLD_SESSION_STATE_READY && !forcedSend))
if (!m_socket || (m_sessionState != WORLD_SESSION_STATE_READY && !forcedSend))
{
//sLog.outDebug("Refused to send %s to %s", packet.GetOpcodeName(), _player ? _player->GetName() : "UKNOWN");
return;
Expand Down Expand Up @@ -774,11 +774,6 @@ void WorldSession::LogoutPlayer()
uint32 guid = _player->GetGUIDLow();
#endif

#ifdef ENABLE_PLAYERBOTS
// Remember player GUID for update SQL below
uint32 guid = _player->GetGUIDLow();
#endif

//Start Solocraft Function
CharacterDatabase.PExecute("DELETE FROM custom_solocraft_character_stats WHERE GUID = %u", _player->GetGUIDLow());
//End Solocraft Function
Expand Down Expand Up @@ -1350,10 +1345,3 @@ void WorldSession::HandleWardenDataOpcode(WorldPacket& recv_data)
{
m_anticheat->WardenPacket(recv_data);
}

#ifdef ENABLE_PLAYERBOTS
void WorldSession::SetNoAnticheat()
{
m_anticheat.reset(new NullSessionAnticheat(this));
}
#endif
4 changes: 0 additions & 4 deletions src/game/Server/WorldSession.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,6 @@ class WorldSession
void SetNoAnticheat();
#endif

#ifdef ENABLE_PLAYERBOTS
void SetNoAnticheat();
#endif

/// Session in auth.queue currently
void SetInQueue(bool state) { m_inQueue = state; }

Expand Down
2 changes: 1 addition & 1 deletion src/game/Spells/UnitAuraProcHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(ProcExecutionData& data)
if (damagePoint >= 0)
{
// currently uses same spell damage fetch as flametongue - need to verify whether SP is supposed to be applied pre-triggered spell bonuses or post
int32 bonusDamage = SpellDamageBonusDone(pVictim, GetSpellSchoolMask(dummySpell), dummySpell, damagePoint, SPELL_DIRECT_DAMAGE); + pVictim->SpellBaseDamageBonusTaken(GetSpellSchoolMask(dummySpell));
int32 bonusDamage = SpellDamageBonusDone(pVictim, GetSpellSchoolMask(dummySpell), dummySpell, EFFECT_INDEX_0, damagePoint, SPELL_DIRECT_DAMAGE); + pVictim->SpellBaseDamageBonusTaken(GetSpellSchoolMask(dummySpell));
//if (Aura* aura = GetAura(43743, EFFECT_INDEX_0)) // Improved Seal of Righteousness
// bonusDamage += aura->GetAmount();
damagePoint += bonusDamage * coeff * CalculateLevelPenalty(dummySpell);
Expand Down
1 change: 1 addition & 0 deletions src/game/World/World.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ uint32 World::m_relocation_ai_notify_delay = 1000u;
uint32 World::m_currentMSTime = 0;
TimePoint World::m_currentTime = TimePoint();
uint32 World::m_currentDiff = 0;
#ifdef ENABLE_PLAYERBOTS
uint32 World::m_currentDiffSum = 0;
uint32 World::m_currentDiffSumIndex = 0;
uint32 World::m_averageDiff = 0;
Expand Down

0 comments on commit 414217b

Please sign in to comment.