CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.65k stars 4.18k forks source link

UPS-powered energy weapons error #49004

Closed AdamChirnside closed 3 years ago

AdamChirnside commented 3 years ago

Describe the bug

When trying to use any UPS-powered weapon, an error is thrown:

DEBUG : can't set ammo null in A7 laser rifle as it is not an ammo

FUNCTION : item& item::ammo_set(const itype_id&, int) FILE : src/item.cpp LINE : 549

Steps To Reproduce

  1. Make a player with an A7 laser rifle (UPS)
  2. Equip it
  3. Get near monsters

Expected behavior

No error message

Screenshots

N/A

Versions and configuration

Additional Context

This seems to be a problem with nested container code

actual-nh commented 3 years ago

Confirmed - see #45041. #48771 is likely related.

AdamChirnside commented 3 years ago

It seems like these weapons simply need to have the USES_BIONIC_POWER flag to fix this. Testing it now Technically that works, but USE_UPS would be a more accurate flag. Changing the C++ to reflect this and testing again

AdamChirnside commented 3 years ago

This seems to have been fixed