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

npc_at_om_location along with u_at_om_location don't register overmap terrains #4122

Open
Kenan2000 opened this issue Jan 18, 2024 · 2 comments · May be fixed by #4168
Open

npc_at_om_location along with u_at_om_location don't register overmap terrains #4122

Kenan2000 opened this issue Jan 18, 2024 · 2 comments · May be fixed by #4168
Labels

Comments

@Kenan2000
Copy link
Collaborator

Describe the bug

Based on code documentation along with code in https://github.com/cataclysmbnteam/Cataclysm-BN/blob/main/src/condition.cpp#L383 which I presume is supposed to accept overmap terrains as input values JSON parameters npc_at_om_location along with u_at_om_location should accept overmap terrains with like overmap_terrain or without directional specifications like overmap_terrain_north but neither overmap_terrain format nor overmap_terrain_north format work correctly, failing to meet condition making NPCs dialogues that literally depend on that broken along with throwing errors that overmap_terrain is invalid even though it clearly exists which it should not do, but either accept overmap_terrain format or overmap_terrain_north format which is it's intended behavior

Steps To Reproduce

  1. Make an NPC dialogue with a condition that either NPC or one of our main characters or both is at a certain in-game location like [ { "id": "TALK_NPC_GO_TO_EVAC_CENTER1", "type": "talk_topic", "dynamic_line": I will follow you to Evac Center", "responses": [ { "text": "Okay", "topic": "TALK_DONE", "effect": "follow_only" }, { "text": "We are at Evac Center", "topic": "TALK_DONE", "condition": { "npc_at_om_location": "evac_center_3" }, "effect": "stop_following" } ] } ] whereas replacing evac_center_3 with evac_center_3_north makes no difference at all with regards to this
  2. Now try to spawn NPC with this dialogue then go to this in-game location
  3. NPC will follow as expected but error will be thrown that this is an invalid location along with NPC not stopping to follow one our main characters

Screenshots

No response

Versions and configuration

I believe that this is present on all versions as it's a hardcode issue so this is not important, at the same time it's very hard to trace if there were any changes to this file on any of versions to find one which broke it but it seems like this code was not working correctly since it's implementation

Additional context

Yeah, not that much to add to this except for the fact that it has been proven that this is not a JSON error or incorrect usage of it at all

@Kenan2000 Kenan2000 added the bug label Jan 18, 2024
@Kenan2000
Copy link
Collaborator Author

@Coolthulhu, @chaosvolt, @olanti-p This pull request fixes it that we need to port CleverRaven/Cataclysm-DDA#44844

@Kenan2000
Copy link
Collaborator Author

Yeah, feel free to add it to list of stuff to port if you guys want to

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant