feat: add mission progression for behaviors (#1962)

* feat: add mission progression for behaviors

* Add const to ptr

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
David Markowitz
2026-03-31 13:02:23 -07:00
committed by GitHub
parent 8283d1fa95
commit 8dfdca7fbd
7 changed files with 43 additions and 14 deletions

View File

@@ -8,7 +8,9 @@
#include "ControlBehaviorMsgs.h"
#include "tinyxml2.h"
#include "InventoryComponent.h"
#include "MissionComponent.h"
#include "SimplePhysicsComponent.h"
#include "eMissionTaskType.h"
#include "eObjectBits.h"
#include "Database.h"
@@ -187,6 +189,8 @@ void ModelComponent::AddBehavior(AddMessage& msg) {
// Check if this behavior is able to be found via lot (if so, its a loot behavior).
insertedBehavior.SetIsLoot(inventoryComponent->FindItemByLot(msg.GetBehaviorId(), eInventoryType::BEHAVIORS));
}
auto* const missionComponent = playerEntity->GetComponent<MissionComponent>();
if (missionComponent) missionComponent->Progress(eMissionTaskType::ADD_BEHAVIOR, 0);
}
auto* const simplePhysComponent = m_Parent->GetComponent<SimplePhysicsComponent>();