mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-09 20:24:16 +00:00
Merge branch 'main' into PetFixes
This commit is contained in:
@@ -398,7 +398,8 @@ void BuffComponent::UpdateXml(tinyxml2::XMLDocument* doc) {
|
||||
|
||||
for (const auto& [id, buff] : m_Buffs) {
|
||||
auto* buffEntry = doc->NewElement("b");
|
||||
if (buff.cancelOnZone || buff.cancelOnLogout) continue;
|
||||
// TODO: change this if to if (buff.cancelOnZone || buff.cancelOnLogout) handling at some point. No current way to differentiate between zone transfer and logout.
|
||||
if (buff.cancelOnZone) continue;
|
||||
|
||||
buffEntry->SetAttribute("id", id);
|
||||
buffEntry->SetAttribute("t", buff.time);
|
||||
|
@@ -557,7 +557,7 @@ void DestroyableComponent::Damage(uint32_t damage, const LWOOBJID source, uint32
|
||||
}
|
||||
|
||||
if (IsImmune() || IsCooldownImmune()) {
|
||||
LOG_DEBUG("Target targetEntity %llu is immune!", m_Parent->GetObjectID()); //Immune is succesfully proc'd
|
||||
LOG_DEBUG("Target targetEntity %llu is immune!", m_Parent->GetObjectID());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -621,3 +621,12 @@ bool MissionComponent::HasCollectible(int32_t collectibleID) {
|
||||
bool MissionComponent::HasMission(uint32_t missionId) {
|
||||
return GetMission(missionId) != nullptr;
|
||||
}
|
||||
|
||||
void MissionComponent::ResetMission(const int32_t missionId) {
|
||||
auto* mission = GetMission(missionId);
|
||||
|
||||
if (!mission) return;
|
||||
|
||||
m_Missions.erase(missionId);
|
||||
GameMessages::SendResetMissions(m_Parent, m_Parent->GetSystemAddress(), missionId);
|
||||
}
|
||||
|
@@ -170,6 +170,7 @@ public:
|
||||
*/
|
||||
bool HasMission(uint32_t missionId);
|
||||
|
||||
void ResetMission(const int32_t missionId);
|
||||
private:
|
||||
/**
|
||||
* All the missions owned by this entity, mapped by mission ID
|
||||
|
@@ -29,11 +29,11 @@ uint32_t OfferedMission::GetMissionId() const {
|
||||
return this->missionId;
|
||||
}
|
||||
|
||||
bool OfferedMission::GetOfferMission() const {
|
||||
bool OfferedMission::GetOffersMission() const {
|
||||
return this->offersMission;
|
||||
}
|
||||
|
||||
bool OfferedMission::GetAcceptMission() const {
|
||||
bool OfferedMission::GetAcceptsMission() const {
|
||||
return this->acceptsMission;
|
||||
}
|
||||
|
||||
@@ -203,7 +203,10 @@ void MissionOfferComponent::OfferMissions(Entity* entity, const uint32_t specifi
|
||||
const auto selected = canAcceptPool[GeneralUtils::GenerateRandomNumber<int>(0, canAcceptPool.size() - 1)];
|
||||
|
||||
GameMessages::SendOfferMission(entity->GetObjectID(), entity->GetSystemAddress(), selected, m_Parent->GetObjectID());
|
||||
} else if (std::find(offered.begin(), offered.end(), missionId) == offered.end() && offeredMission->GetOfferMission()) {
|
||||
} else if (
|
||||
std::find(offered.begin(), offered.end(), missionId) == offered.end()
|
||||
&&
|
||||
(offeredMission->GetOffersMission() || offeredMission->GetAcceptsMission())) {
|
||||
GameMessages::SendOfferMission(entity->GetObjectID(), entity->GetSystemAddress(), missionId, m_Parent->GetObjectID());
|
||||
}
|
||||
}
|
||||
|
@@ -30,13 +30,13 @@ struct OfferedMission {
|
||||
* Returns if this mission is offered by the entity
|
||||
* @return true if this mission is offered by the entity, false otherwise
|
||||
*/
|
||||
bool GetOfferMission() const;
|
||||
bool GetOffersMission() const;
|
||||
|
||||
/**
|
||||
* Returns if this mission may be accepted by the entity (currently unused)
|
||||
* @return true if this mission may be accepted by the entity, false otherwise
|
||||
*/
|
||||
bool GetAcceptMission() const;
|
||||
bool GetAcceptsMission() const;
|
||||
|
||||
private:
|
||||
|
||||
|
@@ -24,6 +24,7 @@ void ShootingGalleryComponent::Serialize(RakNet::BitStream* outBitStream, bool i
|
||||
outBitStream->Write<uint32_t>(0);
|
||||
} else {
|
||||
outBitStream->Write<uint32_t>(1);
|
||||
outBitStream->Write<LWOOBJID>(m_CurrentPlayerID);
|
||||
for (size_t i = 0; i < 10; i++) {
|
||||
outBitStream->Write<float_t>(0.0f);
|
||||
}
|
||||
@@ -60,6 +61,7 @@ void ShootingGalleryComponent::Serialize(RakNet::BitStream* outBitStream, bool i
|
||||
outBitStream->Write<LWOOBJID>(m_CurrentPlayerID);
|
||||
outBitStream->Write<float_t>(m_DynamicParams.cannonTimeout);
|
||||
outBitStream->Write<float_t>(m_DynamicParams.cannonFOV);
|
||||
if (!isInitialUpdate) m_Dirty = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user