Working on projectiles
This commit is contained in:
@@ -1186,12 +1186,12 @@ public sealed partial class DungeonHandler : IClientMessageHandler
|
|||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(ammoType)) return null;
|
if (string.IsNullOrEmpty(ammoType)) return null;
|
||||||
|
|
||||||
var quiverItemId = session.Character.EquippedQuiver;
|
// Get equipped quiver using new equipment system
|
||||||
if (!quiverItemId.HasValue) return null;
|
|
||||||
|
|
||||||
var quiverItem = await db.DungeonCharacterItems
|
var quiverItem = await db.DungeonCharacterItems
|
||||||
.Include(i => i.ItemDefinition)
|
.Include(i => i.ItemDefinition)
|
||||||
.FirstOrDefaultAsync(i => i.Id == quiverItemId.Value, ct);
|
.FirstOrDefaultAsync(i => i.CharacterId == session.CharacterId
|
||||||
|
&& i.IsEquipped
|
||||||
|
&& i.EquipSlot == DungeonEquipmentSlot.Quiver, ct);
|
||||||
|
|
||||||
if (quiverItem?.ItemDefinition == null) return null;
|
if (quiverItem?.ItemDefinition == null) return null;
|
||||||
|
|
||||||
@@ -1201,7 +1201,7 @@ public sealed partial class DungeonHandler : IClientMessageHandler
|
|||||||
// Quiver container - find ammunition in slots
|
// Quiver container - find ammunition in slots
|
||||||
var ammoSlot = await db.DungeonQuiverAmmoSlots
|
var ammoSlot = await db.DungeonQuiverAmmoSlots
|
||||||
.Include(s => s.ItemDefinition)
|
.Include(s => s.ItemDefinition)
|
||||||
.Where(s => s.QuiverCharacterItemId == quiverItemId.Value && s.Quantity > 0)
|
.Where(s => s.QuiverCharacterItemId == quiverItem.Id && s.Quantity > 0)
|
||||||
.OrderBy(s => s.SlotIndex)
|
.OrderBy(s => s.SlotIndex)
|
||||||
.FirstOrDefaultAsync(ct);
|
.FirstOrDefaultAsync(ct);
|
||||||
|
|
||||||
@@ -1221,8 +1221,9 @@ public sealed partial class DungeonHandler : IClientMessageHandler
|
|||||||
quiverItem.Quantity--;
|
quiverItem.Quantity--;
|
||||||
if (quiverItem.Quantity <= 0)
|
if (quiverItem.Quantity <= 0)
|
||||||
{
|
{
|
||||||
// Unequip when empty
|
// Unequip when empty using new equipment system
|
||||||
session.Character.EquippedQuiver = null;
|
quiverItem.IsEquipped = false;
|
||||||
|
quiverItem.EquipSlot = null;
|
||||||
db.DungeonCharacterItems.Remove(quiverItem);
|
db.DungeonCharacterItems.Remove(quiverItem);
|
||||||
}
|
}
|
||||||
await db.SaveChangesAsync(ct);
|
await db.SaveChangesAsync(ct);
|
||||||
|
|||||||
Reference in New Issue
Block a user