mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-04-15 20:26:56 +00:00
fix: adding custom behaviors (#1969)
This commit is contained in:
@@ -189,8 +189,7 @@ 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);
|
||||
ProgressAddBehaviorMission(*playerEntity);
|
||||
}
|
||||
|
||||
auto* const simplePhysComponent = m_Parent->GetComponent<SimplePhysicsComponent>();
|
||||
@@ -200,6 +199,11 @@ void ModelComponent::AddBehavior(AddMessage& msg) {
|
||||
}
|
||||
}
|
||||
|
||||
void ModelComponent::ProgressAddBehaviorMission(Entity& playerEntity) {
|
||||
auto* const missionComponent = playerEntity.GetComponent<MissionComponent>();
|
||||
if (missionComponent) missionComponent->Progress(eMissionTaskType::ADD_BEHAVIOR, 0);
|
||||
}
|
||||
|
||||
std::string ModelComponent::SaveBehavior(const PropertyBehavior& behavior) const {
|
||||
tinyxml2::XMLDocument doc;
|
||||
auto* root = doc.NewElement("Behavior");
|
||||
|
||||
@@ -98,6 +98,8 @@ public:
|
||||
return msg.GetNeedsNewBehaviorID();
|
||||
};
|
||||
|
||||
void ProgressAddBehaviorMission(Entity& playerEntity);
|
||||
|
||||
void AddBehavior(AddMessage& msg);
|
||||
|
||||
void RemoveBehavior(MoveToInventoryMessage& msg, const bool keepItem);
|
||||
|
||||
Reference in New Issue
Block a user