Merge branch 'master' into Playerbot

# Conflicts:
#	src/server/game/World/World.h
This commit is contained in:
郑佩茹
2023-02-09 12:40:25 -07:00
1253 changed files with 114535 additions and 40950 deletions

View File

@@ -1040,7 +1040,7 @@ void GameObject::SaveToDB(bool saveAddon /*= false*/)
{
// this should only be used when the gameobject has already been loaded
// preferably after adding to map, because mapid may not be valid otherwise
GameObjectData const* data = sObjectMgr->GetGOData(m_spawnId);
GameObjectData const* data = sObjectMgr->GetGameObjectData(m_spawnId);
if (!data)
{
LOG_ERROR("entities.gameobject", "GameObject::SaveToDB failed, cannot get gameobject data!");
@@ -1120,7 +1120,7 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask, bool
bool GameObject::LoadGameObjectFromDB(ObjectGuid::LowType spawnId, Map* map, bool addToMap)
{
GameObjectData const* data = sObjectMgr->GetGOData(spawnId);
GameObjectData const* data = sObjectMgr->GetGameObjectData(spawnId);
if (!data)
{
@@ -1442,7 +1442,7 @@ void GameObject::UseDoorOrButton(uint32 time_to_restore, bool alternative /* = f
void GameObject::SetGoArtKit(uint8 kit)
{
SetByteValue(GAMEOBJECT_BYTES_1, 2, kit);
GameObjectData* data = const_cast<GameObjectData*>(sObjectMgr->GetGOData(m_spawnId));
GameObjectData* data = const_cast<GameObjectData*>(sObjectMgr->GetGameObjectData(m_spawnId));
if (data)
data->artKit = kit;
}
@@ -1453,10 +1453,10 @@ void GameObject::SetGoArtKit(uint8 artkit, GameObject* go, ObjectGuid::LowType l
if (go)
{
go->SetGoArtKit(artkit);
data = go->GetGOData();
data = go->GetGameObjectData();
}
else if (lowguid)
data = sObjectMgr->GetGOData(lowguid);
data = sObjectMgr->GetGameObjectData(lowguid);
if (data)
const_cast<GameObjectData*>(data)->artKit = artkit;
@@ -1485,7 +1485,6 @@ void GameObject::Use(Unit* user)
Unit* spellCaster = user;
uint32 spellId = 0;
bool triggered = false;
bool tmpfish = false;
if (Player* playerUser = user->ToPlayer())
{
@@ -1708,7 +1707,6 @@ void GameObject::Use(Unit* user)
// cast this spell later if provided
spellId = info->goober.spellId;
spellCaster = user;
tmpfish = true;
break;
}
@@ -1797,8 +1795,6 @@ void GameObject::Use(Unit* user)
}
else // else: junk
player->SendLoot(GetGUID(), LOOT_FISHING_JUNK);
tmpfish = true;
break;
}
case GO_JUST_DEACTIVATED: // nothing to do, will be deleted at next update
@@ -1812,11 +1808,7 @@ void GameObject::Use(Unit* user)
break;
}
}
if(tmpfish)
player->FinishSpell(CURRENT_CHANNELED_SPELL, true);
else
player->InterruptSpell(CURRENT_CHANNELED_SPELL, true, true, true);
player->FinishSpell(CURRENT_CHANNELED_SPELL, true);
return;
}
@@ -1917,10 +1909,10 @@ void GameObject::Use(Unit* user)
return;
//required lvl checks!
uint8 level = player->getLevel();
uint8 level = player->GetLevel();
if (level < info->meetingstone.minLevel)
return;
level = targetPlayer->getLevel();
level = targetPlayer->GetLevel();
if (level < info->meetingstone.minLevel)
return;
@@ -2108,7 +2100,7 @@ void GameObject::CastSpell(Unit* target, uint32 spellId)
if (Unit* owner = GetOwner())
{
trigger->SetLevel(owner->getLevel(), false);
trigger->SetLevel(owner->GetLevel(), false);
trigger->SetFaction(owner->GetFaction());
// needed for GO casts for proper target validation checks
trigger->SetOwnerGUID(owner->GetGUID());
@@ -2202,7 +2194,7 @@ void GameObject::EventInform(uint32 eventId)
uint32 GameObject::GetScriptId() const
{
if (GameObjectData const* gameObjectData = GetGOData())
if (GameObjectData const* gameObjectData = GetGameObjectData())
if (uint32 scriptId = gameObjectData->ScriptId)
return scriptId;
@@ -2491,7 +2483,7 @@ void GameObject::SetGoState(GOState state)
// startOpen determines whether we are going to add or remove the LoS on activation
/*bool startOpen = (GetGoType() == GAMEOBJECT_TYPE_DOOR || GetGoType() == GAMEOBJECT_TYPE_BUTTON ? GetGOInfo()->door.startOpen : false);
if (GetGOData() && GetGOData()->go_state == GO_STATE_READY)
if (GetGameObjectData() && GetGameObjectData()->go_state == GO_STATE_READY)
startOpen = !startOpen;
if (state == GO_STATE_ACTIVE || state == GO_STATE_ACTIVE_ALTERNATIVE)
@@ -2895,7 +2887,7 @@ void GameObject::GetRespawnPosition(float& x, float& y, float& z, float* ori /*
{
if (m_spawnId)
{
if (GameObjectData const* data = sObjectMgr->GetGOData(m_spawnId))
if (GameObjectData const* data = sObjectMgr->GetGameObjectData(m_spawnId))
{
x = data->posX;
y = data->posY;

View File

@@ -829,7 +829,7 @@ public:
void Update(uint32 p_time) override;
[[nodiscard]] GameObjectTemplate const* GetGOInfo() const { return m_goInfo; }
[[nodiscard]] GameObjectTemplateAddon const* GetTemplateAddon() const;
[[nodiscard]] GameObjectData const* GetGOData() const { return m_goData; }
[[nodiscard]] GameObjectData const* GetGameObjectData() const { return m_goData; }
[[nodiscard]] GameObjectValue const* GetGOValue() const { return &m_goValue; }
[[nodiscard]] bool IsTransport() const;