Parry This!

Parry This!

908k Downloads

Incompatibility with Dungeons Gear Dual Crossbow

Thelnfamous1 opened this issue ยท 3 comments

commented

When a user uses both our mods together, the game crashes when the Dual Crossbow is held.

Infamous-Misadventures/Dungeons-Gear#213

I've pinpointed the issue to this line of code (and the equivalent one for the offhand weapon) not verifying to see if the weapon even has an attack speed attribute (our dual crossbows don't). I suspect a similar crash would also occur if our other non-melee weapons are held.

get(Attributes.ATTACK_SPEED).stream().findFirst().get().getAmount();

It appears to be a simple fix by checking if the attribute is on each of the weapons before getting them, you can change the "get().getAmount()" calls to "map(modifier -> modifier.getAmount()).orElse(0)".

commented

It's worth noting we have recognized that the issue is triggered on our end because we accidentally added attack damage attribute to all of our ranged weapons, which causes them to pass your "isWeapon" check. Still, I would either implement the above change and/or also check that the item has an attack speed attribute in "isWeapon".

commented

Thanks, I'll add this to the next release.

commented

Done! Thanks for the excellent bug report, I apologize for the delay.