Merge branch 'master' into Playerbot

This commit is contained in:
Yunfan Li
2024-04-29 20:00:32 +08:00
6 changed files with 20 additions and 7 deletions

View File

@@ -33,7 +33,7 @@ enum BG_EY_Events
enum BG_EY_Timers
{
BG_EY_FLAG_RESPAWN_TIME = 20 * IN_MILLISECONDS,
BG_EY_FLAG_RESPAWN_TIME = 10 * IN_MILLISECONDS,
BG_EY_FLAG_ON_GROUND_TIME = 10 * IN_MILLISECONDS,
BG_EY_FPOINTS_CHECK_TIME = 2 * IN_MILLISECONDS,
BG_EY_FPOINTS_TICK_TIME = 1 * IN_MILLISECONDS

View File

@@ -406,7 +406,7 @@ bool GameObject::Create(ObjectGuid::LowType guidlow, uint32 name_id, Map* map, u
}
}
LastUsedScriptID = GetGOInfo()->ScriptId;
LastUsedScriptID = GetScriptId();
AIM_Initialize();
if (uint32 linkedEntry = GetGOInfo()->GetLinkedGameObjectEntry())
@@ -1140,6 +1140,7 @@ bool GameObject::LoadGameObjectFromDB(ObjectGuid::LowType spawnId, Map* map, boo
GOState go_state = data->go_state;
uint32 artKit = data->artKit;
m_goData = data;
m_spawnId = spawnId;
if (!Create(map->GenerateLowGuid<HighGuid::GameObject>(), entry, map, phaseMask, x, y, z, ang, data->rotation, animprogress, go_state, artKit))
@@ -1175,8 +1176,6 @@ bool GameObject::LoadGameObjectFromDB(ObjectGuid::LowType spawnId, Map* map, boo
m_respawnTime = 0;
}
m_goData = data;
if (addToMap && !GetMap()->AddToMap(this))
return false;

View File

@@ -136,7 +136,7 @@ void ScriptMgr::OnPlayerReputationRankChange(Player* player, uint32 factionID, R
void ScriptMgr::OnPlayerLearnSpell(Player* player, uint32 spellID)
{
CALL_ENABLED_HOOKS(PlayerScript, PLAYERHOOK_ON_PLAYER_LEARN_TALENTS, script->OnLearnSpell(player, spellID));
CALL_ENABLED_HOOKS(PlayerScript, PLAYERHOOK_ON_LEARN_SPELL, script->OnLearnSpell(player, spellID));
}
void ScriptMgr::OnPlayerForgotSpell(Player* player, uint32 spellID)
@@ -211,7 +211,7 @@ void ScriptMgr::OnBeforePlayerUpdate(Player* player, uint32 p_time)
void ScriptMgr::OnPlayerUpdate(Player* player, uint32 p_time)
{
CALL_ENABLED_HOOKS(PlayerScript, PLAYERHOOK_ON_BEFORE_UPDATE, script->OnUpdate(player, p_time));
CALL_ENABLED_HOOKS(PlayerScript, PLAYERHOOK_ON_UPDATE, script->OnUpdate(player, p_time));
}
void ScriptMgr::OnAfterPlayerUpdate(Player* player, uint32 diff)

View File

@@ -467,7 +467,7 @@ struct npc_echo_of_medivh : public ScriptedAI
break;
}
if (newRow < MAX_ROW && newCol < MAX_COL && newRow >= 0 && newCol >= 0)
if (newRow < MAX_ROW && newCol < MAX_COL)
if (Creature* targetPiece = ObjectAccessor::GetCreature(*me, _boards[newRow][newCol].pieceGUID))
if (!IsFriendly(piece, targetPiece))
return targetPiece;