Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UPS-modded lights do not work #31377

Closed
Inglonias opened this issue Jun 12, 2019 · 7 comments · Fixed by #31766
Closed

UPS-modded lights do not work #31377

Inglonias opened this issue Jun 12, 2019 · 7 comments · Fixed by #31766
Labels
<Bug> This needs to be fixed Items: Gunmod / Toolmod Weapon and tool attachments, and add-ons Items / Item Actions / Item Qualities Items and how they work and interact

Comments

@Inglonias
Copy link
Contributor

Describe the bug

Lighting tools that have been modded to use UPS charges don't work. In 0.D stable, this wasn't so much an issue, as they'd slowly recharge. Now they just plain do not work.

Steps To Reproduce

  1. Create a player with a flashlight and a UPS loaded with a charged battery
  2. Apply a UPS conversion mod to the flashlight
  3. Activate the flashlight. It will immediately go dead.

Expected behavior

The flashlight shines and drains the UPS

Screenshots

If applicable, add screenshots to help explain your problem.

Versions and configuration

  • OS: Windows
    • OS Version: 10.0 1803
  • Game Version: 0.D-4219-g5bce0cd [64-bit]
  • Graphics Version: Tiles
  • Mods loaded: [
    Dark Days Ahead [dda],
    Disable NPC Needs [no_npc_food]
    ]

Additional context

So, I was toodling around with UPS modded tools in an effort to try to understand how they work, and it looks like flashlights are some sort of black sheep. I don't understand how flashlights work in the game code at all.

@Inglonias
Copy link
Contributor Author

Root cause of the bug appears to be that item::ammo_remaining() doesn't take the USE_UPS flag into account when doing the initial ammo check. Curious, since many other UPS powered tools work, but my guess is that because flashlights don't have a special iuse, they're treated differently. I'll have to be careful here.

@Night-Pryanik Night-Pryanik added <Bug> This needs to be fixed Items: Gunmod / Toolmod Weapon and tool attachments, and add-ons Items / Item Actions / Item Qualities Items and how they work and interact labels Jun 15, 2019
@ghost
Copy link

ghost commented Jun 15, 2019

Probably related -UPS toolmod fails to work with not only things such as lights, but also things like mp3 player, thermal electric outfit or soldering iron (and probably many others), saying that there are no charges... at least when using UPS bionic. Haven't tested with UPS wearable battery yet. Yet electric jackhammer or guns with pre-installed UPS work just fine.

@baldamundo
Copy link
Contributor

Probably related -UPS toolmod fails to work with not only things such as lights, but also things like mp3 player, thermal electric outfit or soldering iron (and probably many others), saying that there are no charges... at least when using UPS bionic. Haven't tested with UPS wearable battery yet. Yet electric jackhammer or guns with pre-installed UPS work just fine.

Am encountering the same issue with wearable UPS. Also in the latest build (9170), the game crashes if I examine a vehicle recharging station with a UPS modded tool in it.

@Inglonias
Copy link
Contributor Author

That crash is likely not directly related to this bug, but is likely to be more due to the ammo changes going around. Please file a seperate report on that.

@Inglonias
Copy link
Contributor Author

A heads-up: I have not forgotten about this issue.

It looks like there is an existing function that should work for the situations that we need called units_sufficient which takes UPS charges into account. I guess the first step to fixing this would be to replace a tool's ammo_sufficient calls with units_sufficient and see if that improves anything.

@Inglonias
Copy link
Contributor Author

Also, for my own reference, because I forgot earlier. For flashlights specifically, look at the iuse_actor's transform method for an entry point for this fix.

@Inglonias
Copy link
Contributor Author

Inglonias commented Jun 23, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bug> This needs to be fixed Items: Gunmod / Toolmod Weapon and tool attachments, and add-ons Items / Item Actions / Item Qualities Items and how they work and interact
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants