mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-06 10:44:08 +00:00
fix shooting gallery bugs (#1702)
This commit is contained in:
@@ -69,9 +69,10 @@ InventoryComponent::InventoryComponent(Entity* parent) : Component(parent) {
|
||||
auto slot = 0u;
|
||||
|
||||
for (const auto& item : items) {
|
||||
if (!item.equip || !Inventory::IsValidItem(item.itemid)) {
|
||||
continue;
|
||||
}
|
||||
if (!Inventory::IsValidItem(item.itemid)) continue;
|
||||
AddItem(item.itemid, item.count);
|
||||
|
||||
if (!item.equip) continue;
|
||||
|
||||
const LWOOBJID id = ObjectIDManager::GenerateObjectID();
|
||||
|
||||
|
@@ -265,6 +265,7 @@ void MovementAIComponent::PullToPoint(const NiPoint3& point) {
|
||||
|
||||
void MovementAIComponent::SetPath(std::vector<PathWaypoint> path) {
|
||||
if (path.empty()) return;
|
||||
while (!m_CurrentPath.empty()) m_CurrentPath.pop();
|
||||
std::for_each(path.rbegin(), path.rend() - 1, [this](const PathWaypoint& point) {
|
||||
this->m_CurrentPath.push(point);
|
||||
});
|
||||
|
@@ -524,7 +524,7 @@ void PetComponent::NotifyTamingBuildSuccess(NiPoint3 position) {
|
||||
|
||||
GameMessages::SendRegisterPetDBID(m_Tamer, petSubKey, tamer->GetSystemAddress());
|
||||
|
||||
inventoryComponent->AddItem(m_Parent->GetLOT(), 1, eLootSourceType::ACTIVITY, eInventoryType::MODELS, {}, LWOOBJID_EMPTY, true, false, petSubKey);
|
||||
inventoryComponent->AddItem(m_Parent->GetLOT(), 1, eLootSourceType::INVENTORY, eInventoryType::MODELS, {}, LWOOBJID_EMPTY, true, false, petSubKey);
|
||||
auto* item = inventoryComponent->FindItemBySubKey(petSubKey, MODELS);
|
||||
|
||||
if (item == nullptr) {
|
||||
|
@@ -123,6 +123,11 @@ void SkillComponent::SyncPlayerProjectile(const LWOOBJID projectileId, RakNet::B
|
||||
behavior->Handle(sync_entry.context, bitStream, branch);
|
||||
|
||||
this->m_managedProjectiles.erase(this->m_managedProjectiles.begin() + index);
|
||||
|
||||
GameMessages::ActivityNotify notify;
|
||||
notify.notification.push_back( std::make_unique<LDFData<int32_t>>(u"shot_done", sync_entry.skillId));
|
||||
|
||||
m_Parent->OnActivityNotify(notify);
|
||||
}
|
||||
|
||||
void SkillComponent::RegisterPlayerProjectile(const LWOOBJID projectileId, BehaviorContext* context, const BehaviorBranchContext& branch, const LOT lot) {
|
||||
@@ -132,6 +137,7 @@ void SkillComponent::RegisterPlayerProjectile(const LWOOBJID projectileId, Behav
|
||||
entry.branchContext = branch;
|
||||
entry.lot = lot;
|
||||
entry.id = projectileId;
|
||||
entry.skillId = context->skillID;
|
||||
|
||||
this->m_managedProjectiles.push_back(entry);
|
||||
}
|
||||
|
@@ -40,6 +40,8 @@ struct ProjectileSyncEntry {
|
||||
|
||||
BehaviorBranchContext branchContext{ 0, 0 };
|
||||
|
||||
int32_t skillId{ 0 };
|
||||
|
||||
explicit ProjectileSyncEntry();
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user