mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-22 21:47:24 +00:00
Qb team credit (#912)
* give credit to whole team for qb's * fix compiling
This commit is contained in:
parent
96313ecd69
commit
9ebb06ba24
@ -14,6 +14,7 @@
|
|||||||
#include "Spawner.h"
|
#include "Spawner.h"
|
||||||
#include "MovingPlatformComponent.h"
|
#include "MovingPlatformComponent.h"
|
||||||
#include "Preconditions.h"
|
#include "Preconditions.h"
|
||||||
|
#include "TeamManager.h"
|
||||||
|
|
||||||
#include "CppScripts.h"
|
#include "CppScripts.h"
|
||||||
|
|
||||||
@ -464,12 +465,20 @@ void RebuildComponent::CompleteRebuild(Entity* user) {
|
|||||||
|
|
||||||
auto* builder = GetBuilder();
|
auto* builder = GetBuilder();
|
||||||
|
|
||||||
if (builder != nullptr) {
|
if (builder) {
|
||||||
auto* missionComponent = builder->GetComponent<MissionComponent>();
|
auto* team = TeamManager::Instance()->GetTeam(builder->GetObjectID());
|
||||||
if (missionComponent != nullptr) {
|
if (team) {
|
||||||
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_ACTIVITY, m_ActivityId);
|
for (const auto memberId : team->members) { // progress missions for all team members
|
||||||
|
auto* member = EntityManager::Instance()->GetEntity(memberId);
|
||||||
|
if (member) {
|
||||||
|
auto* missionComponent = member->GetComponent<MissionComponent>();
|
||||||
|
if (missionComponent) missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_ACTIVITY, m_ActivityId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else{
|
||||||
|
auto* missionComponent = builder->GetComponent<MissionComponent>();
|
||||||
|
if (missionComponent) missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_ACTIVITY, m_ActivityId);
|
||||||
}
|
}
|
||||||
|
|
||||||
LootGenerator::Instance().DropActivityLoot(builder, m_Parent, m_ActivityId, 1);
|
LootGenerator::Instance().DropActivityLoot(builder, m_Parent, m_ActivityId, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user