CleverRaven / Cataclysm-DDA

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

`The required items are not available to complete the %s at zone %s` #74258

Open Brambor opened 1 month ago

Brambor commented 1 month ago

Describe the bug

Trying to mine in the designed zone. I get a message explaining the failure with broken formatting:

image

Attach save file

Winter Beach-trimmed.tar.gz

Steps to reproduce

  1. Load attached save.
  2. O to open the Zone activity menu.
  3. Mine area.
  4. Observe the message log with the nondescriptive message ending in The required items are not available to complete the %s at zone %s

Expected behavior

The message formats correctly.

Screenshots

No response

Versions and configuration

Additional context

No response

Brambor commented 1 month ago

It feels like the zone name is the unformatted sentence. In other words, it correctly formats the string but substitutes the second %s for a copy of the whole unformatted string.

PatrikLundell commented 1 month ago

The reason is probably that the parameters to you.add_msg_player_or_npc in activity_item_handling.cpp operation requirement_check_result are organized incorrectly. Looking at the profile it may be that the two strings should come first and their parameters should somehow be piled up into two trailing parameters. It could also be that the profile should be interpreted completely differently...