Merge branch 'master' into Playerbot

This commit is contained in:
Yunfan Li
2024-09-07 14:27:11 +08:00
12 changed files with 1266 additions and 864 deletions

View File

@@ -23,8 +23,8 @@
namespace MMAP
{
static char const* const MAP_FILE_NAME_FORMAT = "%s/mmaps/%03i.mmap";
static char const* const TILE_FILE_NAME_FORMAT = "%s/mmaps/%03i%02i%02i.mmtile";
static char const* const MAP_FILE_NAME_FORMAT = "{}/mmaps/{:03}.mmap";
static char const* const TILE_FILE_NAME_FORMAT = "{}/mmaps/{:03}{:02}{:02}.mmtile";
// ######################## MMapMgr ########################
MMapMgr::~MMapMgr()

View File

@@ -3481,7 +3481,7 @@ void Creature::UpdateMovementFlags()
float Creature::GetNativeObjectScale() const
{
return GetCreatureTemplate()->scale;
return ObjectMgr::ChooseDisplayId(GetCreatureTemplate())->DisplayScale;
}
void Creature::SetObjectScale(float scale)

View File

@@ -265,7 +265,7 @@ void Player::Update(uint32 p_time)
if (!IsPositionValid()) // pussywizard: will crash below at eg. GetZoneAndAreaId
{
LOG_INFO("misc", "Player::Update - invalid position ({0:.1f}, {0:.1f}, {0:.1f})! Map: {}, MapId: {}, {}",
LOG_INFO("misc", "Player::Update - invalid position ({:0.1f}, {:0.1f}, {:0.1f})! Map: {}, MapId: {}, {}",
GetPositionX(), GetPositionY(), GetPositionZ(), (FindMap() ? FindMap()->GetId() : 0), GetMapId(), GetGUID().ToString());
GetSession()->KickPlayer("Invalid position");
return;

View File

@@ -1041,6 +1041,10 @@ uint32 Unit::DealDamage(Unit* attacker, Unit* victim, uint32 damage, CleanDamage
if (!victim->IsPlayer())
{
/// @fix: Hack to avoid premature leashing
if (damagetype != DOT && damage > 0 && !victim->GetOwnerGUID().IsPlayer() && (!spellProto || !spellProto->HasAura(SPELL_AURA_DAMAGE_SHIELD)))
victim->ToCreature()->UpdateLeashExtensionTime();
if (attacker)
{
if (spellProto && victim->CanHaveThreatList() && !victim->HasUnitState(UNIT_STATE_EVADE) && !victim->IsInCombatWith(attacker))
@@ -13554,8 +13558,6 @@ void Unit::SetInCombatWith(Unit* enemy, uint32 duration)
return;
}
}
if (Creature* pCreature = ToCreature())
pCreature->UpdateLeashExtensionTime();
SetInCombatState(false, enemy, duration);
}
@@ -13714,6 +13716,8 @@ void Unit::SetInCombatState(bool PvP, Unit* enemy, uint32 duration)
if (enemy)
{
creature->UpdateLeashExtensionTime();
if (IsAIEnabled)
creature->AI()->JustEngagedWith(enemy);

View File

@@ -627,7 +627,7 @@ public:
if (object->GetTransport())
{
handler->PSendSysMessage("Transport offset: %.2f, %.2f, %.2f, %.2f", object->m_movementInfo.transport.pos.GetPositionX(), object->m_movementInfo.transport.pos.GetPositionY(), object->m_movementInfo.transport.pos.GetPositionZ(), object->m_movementInfo.transport.pos.GetOrientation());
handler->PSendSysMessage("Transport offset: {:0.2f}, {:0.2f}, {:0.2f}, {:0.2f}", object->m_movementInfo.transport.pos.GetPositionX(), object->m_movementInfo.transport.pos.GetPositionY(), object->m_movementInfo.transport.pos.GetPositionZ(), object->m_movementInfo.transport.pos.GetOrientation());
}
return true;

View File

@@ -1130,7 +1130,7 @@ public:
me->LoadCreaturesAddon(true);
me->SetLootRecipient(nullptr);
me->ResetPlayerDamageReq();
me->UpdateLeashExtensionTime();
me->ClearLastLeashExtensionTimePtr();
}
};

File diff suppressed because it is too large Load Diff

View File

@@ -122,6 +122,8 @@ foreach(TOOL_NAME ${TOOLS_BUILD_LIST})
PUBLIC
database
PRIVATE
modules
scripts
acore-core-interface)
# Install config
@@ -153,6 +155,8 @@ foreach(TOOL_NAME ${TOOLS_BUILD_LIST})
target_include_directories(${TOOL_PROJECT_NAME}
PUBLIC
${TOOL_PUBLIC_INCLUDES}
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/modules
PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/${TOOL_NAME})

View File

@@ -103,8 +103,15 @@ bool StartDB()
{
MySQL::Library_Init();
// Load databases
DatabaseLoader loader("dbimport");
// Load modules conditionally based on what modules are allowed to auto-update or none
std::string modules = sConfigMgr->GetOption<std::string>("Updates.AllowedModules", "all");
LOG_INFO("dbimport", "Loading modules: {}", modules.empty() ? "none" : modules);
DatabaseLoader loader =
modules.empty() ? DatabaseLoader("dbimport") :
(modules == "all") ? DatabaseLoader("dbimport", DatabaseLoader::DATABASE_NONE, AC_MODULES_LIST) :
DatabaseLoader("dbimport", DatabaseLoader::DATABASE_NONE, modules);
loader
.AddDatabase(LoginDatabase, "Login")
.AddDatabase(CharacterDatabase, "Character")

View File

@@ -159,6 +159,17 @@ CharacterDatabase.SynchThreads = 1
Updates.EnableDatabases = 7
#
# Updates.AllowedModules
# Description: A list of modules that are allowed to be updated automatically by the DBImport tool.
# If the list is empty, no modules are allowed to automatically update. (current behavior)
# Default: "" - (No modules are allowed)
#
# Example: "mod_name,mod_name2,mod_name3" (selected modules)
# "all" - (All modules are allowed)
#
Updates.AllowedModules = "all"
#
# Updates.AutoSetup
# Description: Auto populate empty databases.