mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-15 16:27:14 +00:00
fix: a worn jetpack works again after a world change
Jetpack mode is not saved, and the equip skill that turns it on was cast only when the item was put on, so a player still wearing a jetpack lost it in the next world. Live sent SetJetPackMode (use, bypass checks, effect 167, the values of the jetpack's equip skill) shortly after the player's own construction in 12 of 28 world loads of a player with a jetpack, and constructed the player in jetpack mode in the other 16. The jetpack behaviors among the equip skills of the equipped items are run again when the player has loaded. Nothing new is saved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
#include "ZoneMessages.h"
|
||||
#include "MovementMessages.h"
|
||||
#include "SkillComponent.h"
|
||||
#include "Behavior.h"
|
||||
#include "Character.h"
|
||||
#include "EntityManager.h"
|
||||
#include "ItemSet.h"
|
||||
@@ -1694,6 +1695,20 @@ std::vector<uint32_t> InventoryComponent::FindBuffs(Item* item, bool castOnEquip
|
||||
return buffs;
|
||||
}
|
||||
|
||||
std::vector<uint32_t> InventoryComponent::FindEquippedJetPacks() const {
|
||||
std::vector<uint32_t> jetPacks;
|
||||
for (const auto& equipped : m_Equipped | std::views::values) {
|
||||
for (const auto behaviorID : FindBuffs(FindItemById(equipped.id), false)) {
|
||||
if (Behavior::GetBehaviorTemplate(behaviorID) == BehaviorTemplate::JETPACK) jetPacks.push_back(behaviorID);
|
||||
}
|
||||
}
|
||||
return jetPacks;
|
||||
}
|
||||
|
||||
void InventoryComponent::RecastEquippedJetPacks() const {
|
||||
for (const auto behaviorID : FindEquippedJetPacks()) SkillComponent::HandleUnmanaged(behaviorID, m_Parent->GetObjectID());
|
||||
}
|
||||
|
||||
void InventoryComponent::SetNPCItems(const std::vector<LOT>& items) {
|
||||
m_Equipped.clear();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user