Working on projectiles
This commit is contained in:
@@ -1024,13 +1024,12 @@ public sealed partial class DungeonHandler : IClientMessageHandler
|
|||||||
using var scope = _scopeFactory.CreateScope();
|
using var scope = _scopeFactory.CreateScope();
|
||||||
var db = scope.ServiceProvider.GetRequiredService<GameDbContext>();
|
var db = scope.ServiceProvider.GetRequiredService<GameDbContext>();
|
||||||
|
|
||||||
// Get equipped weapon
|
// Get equipped weapon using new equipment system
|
||||||
var weaponItemId = session.Character.EquippedWeapon;
|
|
||||||
if (!weaponItemId.HasValue) return;
|
|
||||||
|
|
||||||
var weaponItem = await db.DungeonCharacterItems
|
var weaponItem = await db.DungeonCharacterItems
|
||||||
.Include(i => i.ItemDefinition)
|
.Include(i => i.ItemDefinition)
|
||||||
.FirstOrDefaultAsync(i => i.Id == weaponItemId.Value, ct);
|
.FirstOrDefaultAsync(i => i.CharacterId == session.CharacterId
|
||||||
|
&& i.IsEquipped
|
||||||
|
&& i.EquipSlot == DungeonEquipmentSlot.MainHand, ct);
|
||||||
|
|
||||||
if (weaponItem?.ItemDefinition == null) return;
|
if (weaponItem?.ItemDefinition == null) return;
|
||||||
var weapon = weaponItem.ItemDefinition;
|
var weapon = weaponItem.ItemDefinition;
|
||||||
|
|||||||
Reference in New Issue
Block a user