Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop item bags no longer show up when spawning empty #254

Merged
merged 1 commit into from
Apr 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ public List<InstancedGatheringItem> GetAssets(StageId stageId, T subGroupId)
if(!_gatheringItemsDictionary.ContainsKey((stageId, subGroupId)))
{
List<GatheringItem> items = FetchItemsFromRepository(stageId, subGroupId);
List<InstancedGatheringItem> instancedItems = items.Select(item => new InstancedGatheringItem(item)).ToList();
List<InstancedGatheringItem> instancedItems = items
.Select(item => new InstancedGatheringItem(item))
.Where(instancedItem => instancedItem.ItemNum > 0)
.ToList();
_gatheringItemsDictionary.Add((stageId, subGroupId), instancedItems);
return instancedItems;
}
Expand Down
5 changes: 3 additions & 2 deletions Arrowgene.Ddon.GameServer/Handler/InstanceEnemyKillHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Arrowgene.Ddon.Shared.Network;
using Arrowgene.Logging;
using Arrowgene.Ddon.GameServer.Party;
using System.Collections.Generic;

namespace Arrowgene.Ddon.GameServer.Handler
{
Expand All @@ -26,8 +27,8 @@ public InstanceEnemyKillHandler(DdonGameServer server) : base(server)
public override void Handle(GameClient client, StructurePacket<C2SInstanceEnemyKillReq> packet)
{
Enemy enemyKilled = Server.AssetRepository.EnemySpawnAsset.Enemies[(StageId.FromStageLayoutId(packet.Structure.LayoutId), 0)][(int) packet.Structure.SetId];

if(enemyKilled.DropsTable != null && enemyKilled.DropsTable.Items.Count > 0) {
List<InstancedGatheringItem> instancedGatheringItems = client.InstanceDropItemManager.GetAssets(packet.Structure.LayoutId, packet.Structure.SetId);
if(instancedGatheringItems.Count > 0) {
client.Party.SendToAll(new S2CInstancePopDropItemNtc()
{
LayoutId = packet.Structure.LayoutId,
Expand Down
Loading