CleverRaven / Cataclysm-DDA

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

Dead code in talk_function::companion_mission #50675

Open hexagonrecursion opened 2 years ago

hexagonrecursion commented 2 years ago

Describe the bug

This code references role_id "REFUGEE MERCHANT" https://github.com/CleverRaven/Cataclysm-DDA/blob/998d767d441192ea67516ce3e7ed668ead25ee84/src/mission_companion.cpp#L134-L137 But as far as I can tell there is no such role_id

fgrep -r "REFUGEE MERCHANT"
Cataclysm-DDA/src/mission_companion.cpp:    } else if( role_id == "REFUGEE MERCHANT" ) {

I think this is dead code

Steps To Reproduce

Search for the "REFUGEE MERCHANT" role id

Expected behavior

No dead code

Screenshots

No response

Versions and configuration

998d767d441192ea67516ce3e7ed668ead25ee84

Additional context

No response

hexagonrecursion commented 2 years ago

This id was removed by 2b800b7861621e0619471632be5aab2d9c378dd4

actual-nh commented 2 years ago

npcs/refugee_center/surface_staff/NPC_free_merchant_shopkeep.json has REFUGEE_MERCHANT ("effect": { "companion_mission": "REFUGEE_MERCHANT" },); does the _ need removal? Ping: @I-am-Erk?

hexagonrecursion commented 2 years ago

This too is dead code: It checks whether the player has NPC_MISSION_LEV_1. I can't find any way for the player to get this trait. https://github.com/CleverRaven/Cataclysm-DDA/blob/5b0c21832ab74c439dd1e66897d80767e28c0ecb/data/json/npcs/refugee_center/surface_staff/NPC_free_merchant_shopkeep.json#L262-L263

I added the trait to the player via debug and can confirm that the underscore breaks companion_mission - when I select the option the dialogue closes instead of offering me a mission list.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not \'bump\' or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.