You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MegaMekLab 0.49.15 (also verified on latest master)
Windows 10, Java Version: 11
Since Coolant Pods are implemented as an ammo type within MegaMek, there in the past was some issues with them not appearing in the Equipment Database View. Some time back I supplied a then merged PR to show Coolant Pods as part of the Other category (PR #1027 / issue #1026), which was a more intuitive way to solve this issue.
Now it seems this fix has broken due to other logic around equipment database views changing.
The reason seems to be that with commit a22a802 a new check for AmmoType equipment's useability has been added to the global hidden equipment check, the last line in this method:
This filter check calls !UnitUtil.canUseAmmo(en, (AmmoType) eq, false)),
which in turn checks against all weapons of the unit for any that can fire the AmmoType, before allowing it to be displayed in the view.
However, this logic does not consider the case that Coolant Pods are implemented as an AmmoType even though no weapon can fire them, and as a result are not able to be shown under the Other (or any tab) without having to disable the Ammo w/o WeaponHide filter - which is very counterintuitive.
A simple solution would be to just add an exception to this logic, so Coolant Pods are not being checked for being usable by a unit's weapons, e.g. at line 119 add something like && ((AmmoType)eq).getAmmoType() != AmmoType.T_COOLANT_POD.
This however makes Coolant Pods always appear in the Ammo view, since it technically is an AmmoType and that view now doesn't filter it out because it is exempt from the hidden equipment check.
The fix here could be to add an exclusion check in the Ammo to not show Coolant Pods in similar fashion to the check above.
But I don't know if you would prefer a more robust solution as this is the second time (that I am aware of) the same feature broke due to similar issue with not considering how Coolant Pods are implemented.
However, if a PR for the simple fix above is enough, I will happily submit one.
The text was updated successfully, but these errors were encountered:
MegaMekLab 0.49.15 (also verified on latest master)
Windows 10, Java Version: 11
Since Coolant Pods are implemented as an ammo type within MegaMek, there in the past was some issues with them not appearing in the Equipment Database View. Some time back I supplied a then merged PR to show Coolant Pods as part of the Other category (PR #1027 / issue #1026), which was a more intuitive way to solve this issue.
Now it seems this fix has broken due to other logic around equipment database views changing.
The reason seems to be that with commit a22a802 a new check for AmmoType equipment's useability has been added to the global hidden equipment check, the last line in this method:
This filter check calls
!UnitUtil.canUseAmmo(en, (AmmoType) eq, false))
,which in turn checks against all weapons of the unit for any that can fire the AmmoType, before allowing it to be displayed in the view.
However, this logic does not consider the case that Coolant Pods are implemented as an AmmoType even though no weapon can fire them, and as a result are not able to be shown under the Other (or any tab) without having to disable the Ammo w/o Weapon Hide filter - which is very counterintuitive.
A simple solution would be to just add an exception to this logic, so Coolant Pods are not being checked for being usable by a unit's weapons, e.g. at line 119 add something like
&& ((AmmoType)eq).getAmmoType() != AmmoType.T_COOLANT_POD
.This however makes Coolant Pods always appear in the Ammo view, since it technically is an AmmoType and that view now doesn't filter it out because it is exempt from the hidden equipment check.
The fix here could be to add an exclusion check in the Ammo to not show Coolant Pods in similar fashion to the check above.
But I don't know if you would prefer a more robust solution as this is the second time (that I am aware of) the same feature broke due to similar issue with not considering how Coolant Pods are implemented.
However, if a PR for the simple fix above is enough, I will happily submit one.
The text was updated successfully, but these errors were encountered: