Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/cmangos/playerbots
Browse files Browse the repository at this point in the history
  • Loading branch information
mostlikely4r committed Jan 11, 2025
2 parents bcc03c3 + 1d254a6 commit 46e16f5
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 35 deletions.
2 changes: 1 addition & 1 deletion playerbot/PlayerbotLLMInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ std::vector<std::string> PlayerbotLLMInterface::ParseResponse(const std::string&

actualResponse = extractAfterPattern(actualResponse, startPattern);

PlayerbotTextMgr::replaceAll(actualResponse, R"(\")", "'");
PlayerbotTextMgr::ReplaceAll(actualResponse, R"(\")", "'");

if (debug)
{
Expand Down
4 changes: 2 additions & 2 deletions playerbot/PlayerbotTextMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ std::string PlayerbotTextMgr::GetBotText(std::string name, std::map<std::string,
if (botText.empty())
botText = name;

replacePlaceholders(botText, placeholders);
ReplacePlaceholders(botText, placeholders);

return botText;
}
Expand Down Expand Up @@ -156,7 +156,7 @@ std::string PlayerbotTextMgr::GetBotText(ChatReplyType replyType, std::map<std::
botText = textEntry.m_text;
}

replacePlaceholders(botText, placeholders);
ReplacePlaceholders(botText, placeholders);

return botText;
}
Expand Down
39 changes: 17 additions & 22 deletions playerbot/TravelNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void TravelNodePath::calculateCost(bool distanceOnly)

if (lastPoint && point.getMapId() == lastPoint.getMapId())
{
if (!distanceOnly && (point.isInWater() || lastPoint.isInWater()))
if (!distanceOnly && (point.isVmapLoaded() && point.isInWater()) || (lastPoint.isVmapLoaded() && lastPoint.isInWater()))
swimDistance += point.distance(lastPoint);

distance += point.distance(lastPoint);
Expand Down Expand Up @@ -1843,8 +1843,23 @@ void TravelNodeMap::manageNodes(Unit* bot, bool mapFull)

void TravelNodeMap::LoadMaps()
{
#ifdef MANGOSBOT_ZERO
sLog.outError("Trying to load all maps and tiles for node generation. Please ignore any maps that could not be loaded.");
for (uint32 i = 0; i < sMapStore.GetNumRows(); ++i)
{
if (!sMapStore.LookupEntry(i))
continue;

uint32 mapId = sMapStore.LookupEntry(i)->MapID;
if (mapId == 0 || mapId == 1 || mapId == 530 || mapId == 571)
{
MMAP::MMapFactory::createOrGetMMapManager()->loadAllMapTiles(sWorld.GetDataPath(), mapId);
}
else
{
MMAP::MMapFactory::createOrGetMMapManager()->loadMapInstance(sWorld.GetDataPath(), mapId, 0);
}
}

for (uint32 i = 0; i < sMapStore.GetNumRows(); ++i)
{
if (!sMapStore.LookupEntry(i))
Expand All @@ -1871,26 +1886,6 @@ void TravelNodeMap::LoadMaps()
}
}
}
#endif
#ifdef MANGOSBOT_ONE
sLog.outError("Trying to load all maps and tiles for node generation. Please ignore any maps that could not be loaded.");
for (uint32 i = 0; i < sMapStore.GetNumRows(); ++i)
{
if (!sMapStore.LookupEntry(i))
continue;

uint32 mapId = sMapStore.LookupEntry(i)->MapID;
if (mapId == 0 || mapId == 1 || mapId == 530 || mapId == 571)
{
MMAP::MMapFactory::createOrGetMMapManager()->loadAllMapTiles(sWorld.GetDataPath(), mapId);
}
else
{
MMAP::MMapFactory::createOrGetMMapManager()->loadMapInstance(sWorld.GetDataPath(), mapId, 0);
}
}
#endif

}

void TravelNodeMap::generateNpcNodes()
Expand Down
16 changes: 8 additions & 8 deletions playerbot/WorldPosition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -686,10 +686,10 @@ bool WorldPosition::loadMapAndVMap(uint32 mapId, uint32 instanceId, int x, int y
{
std::string logName = "load_map_grid.csv";

bool hasVmap = isVmapLoaded(mapId, x, y);
//bool hasVmap = isVmapLoaded(mapId, x, y);
bool hasMmap = isMmapLoaded(mapId, instanceId, x, y);

if (hasVmap && hasMmap)
if (hasMmap)
return true;

if (sTravelMgr.IsBadMmap(mapId, x, y))
Expand Down Expand Up @@ -718,14 +718,14 @@ bool WorldPosition::loadMapAndVMap(uint32 mapId, uint32 instanceId, int x, int y
#endif


if (!isLoaded)
sTravelMgr.AddBadMmap(mapId, x, y);
//if (!isLoaded)
// sTravelMgr.AddBadMmap(mapId, x, y);
}

if (!hasVmap)
{
loadVMap(mapId, x, y);
}
//if (!hasVmap)
//{
// loadVMap(mapId, x, y);
//}

if (sPlayerbotAIConfig.hasLog(logName))
{
Expand Down
4 changes: 2 additions & 2 deletions playerbot/strategy/actions/RtscAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ bool RTSCAction::Execute(Event& event)

if (filePerBot)
{
PlayerbotTextMgr::replaceAll(fileName, "BOTNAME", playerName);
PlayerbotTextMgr::ReplaceAll(fileName, "BOTNAME", playerName);
sPlayerbotAIConfig.openLog(fileName, "w", true);
}

Expand Down Expand Up @@ -217,7 +217,7 @@ bool RTSCAction::Execute(Event& event)

if (filePerBot)
{
PlayerbotTextMgr::replaceAll(fileName, "BOTNAME", playerName);
PlayerbotTextMgr::ReplaceAll(fileName, "BOTNAME", playerName);
}

std::string m_logsDir = sConfig.GetStringDefault("LogsDir");
Expand Down

0 comments on commit 46e16f5

Please sign in to comment.