Closed sven-n closed 5 months ago
Thank you for the excellent summary.
After discovering the staff-shield situation, I did some tests. It appears that the client already prevents most invalid combinations, with shields being the primary exceptions.
I've opened Issue #393 to address these shield cases.
Yea, however, we should also make sure that the server prevents invalid things - we don't want to trust the client :)
Indeed. It seems plausible to expand the group
checks to include more invalid cases. Just gotta list all of them.
Describe the bug Two handed weapons can be equipped, even if a shield is already equipped.
To Reproduce Steps to reproduce the behavior:
Chaos Lightning Staff
and aSkull Shield
.Expected behavior The staff should not be able to be equipped. Also, if you equip the staff first, the shield should not be able to be equipped.
Additional context We can determine if a weapon requires two hands based on the width of the item. Every weapon which needs two hands is at least 2 fields wide. The behavior is wrongly implemented here, as it only considers to prevent equipping, when the item to equip is a weapon which can be equipped on both hands (one-handed swords), and there is already an two-handed item equipped on the left hand: https://github.com/MUnique/OpenMU/blob/6b933062f3de667ac67c279355e15fbc6640812b/src/GameLogic/PlayerActions/Items/MoveItemAction.cs#L237-L243
This logic needs to consider more cases, probably even preventing to equip a shield when an elf already equipped a bow or crossbow. For elfs there is an exception for arrows and bolts - they occupy a slot, but not use any hand. However, when arrows or bolts are equipped it makes to sense to allow shields.