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

EOC OMT search functions look for matching type #75836

Merged
merged 2 commits into from
Aug 30, 2024

Conversation

RenechCDDA
Copy link
Member

@RenechCDDA RenechCDDA commented Aug 19, 2024

Summary

None

Purpose of change

Ran into a small error with how EOCs search for OMTs, found out it had been worked around in other places...

{ "not": { "u_near_om_location": "road_curved", "range": 1 } },
{ "not": { "u_near_om_location": "road_four_way", "range": 1 } },
{ "not": { "u_near_om_location": "road_tee", "range": 1 } },
{ "not": { "u_near_om_location": "road_straight", "range": 1 } },
{ "not": { "u_near_om_location": "road_end", "range": 1 } },
{ "not": { "u_near_om_location": "road_sw", "range": 1 } },
{ "not": { "u_near_om_location": "road_ne", "range": 1 } },
{ "not": { "u_near_om_location": "road_ew", "range": 1 } },
{ "not": { "u_near_om_location": "road_ns", "range": 1 } },
{ "not": { "u_near_om_location": "road_nesw", "range": 1 } },
{ "not": { "u_near_om_location": "road", "range": 1 } }

Describe the solution

Properly remove all mapgen-related suffixes when using the EOC functions near_om_location and at_om_location, not just the cardinal direction ones. This includes directional line connections as well as mutables.

Clean up all the duplicated json lines previously used to work around this issue.

Describe alternatives you've considered

This bug may be present in other calls to oter_no_dir but this is just trying to fix what I know is wrong, rather than an endless fishing expedition

Testing

Additional context

In draft until I push another commit for the json changes Remaining in draft for more testing

There were some existing checks for river_c_not_sw(etc) which I did not touch. These appear to be hardcoded definitions, not actual rotations. Weird stuff!

@RenechCDDA
Copy link
Member Author

@Maleclypse I'm vaguely concerned about how it will interact with this:

{ "u_at_om_location": "arvore_genius_loci_NW" },

arvore_genius_loci_NW is a manually defined ID, not a rotation or connection? I would ask if you can check EOCs checking for this location still function as expected. It should only be trimming _nw and not the capitalized version, but if it has unexpected changes I may need to consider a different approach.

@github-actions github-actions bot added [JSON] Changes (can be) made in JSON Mods Issues related to mods or modding Map / Mapgen Overmap, Mapgen, Map extras, Map display Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies [C++] Changes (can be) made in C++. Previously named `Code` Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. Mods: Magiclysm Anything to do with the Magiclysm mod Mechanics: Enchantments / Spells Enchantments and spells EOC: Effects On Condition Anything concerning Effects On Condition Mods: Xedra Evolved Anything to do with Xedra Evolved labels Aug 19, 2024
@RenechCDDA RenechCDDA force-pushed the oter_search_all_types branch from 4fe32ab to c4f221a Compare August 19, 2024 20:11
@github-actions github-actions bot added astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions and removed json-styled JSON lint passed, label assigned by github actions labels Aug 19, 2024
@RenechCDDA RenechCDDA force-pushed the oter_search_all_types branch from c4f221a to 13df54e Compare August 20, 2024 04:00
@github-actions github-actions bot added json-styled JSON lint passed, label assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Aug 20, 2024
@RenechCDDA RenechCDDA marked this pull request as ready for review August 20, 2024 05:02
@github-actions github-actions bot added BasicBuildPassed This PR builds correctly, label assigned by github actions and removed BasicBuildPassed This PR builds correctly, label assigned by github actions labels Aug 20, 2024
@Maleclypse
Copy link
Member

@Maleclypse I'm vaguely concerned about how it will interact with this:

{ "u_at_om_location": "arvore_genius_loci_NW" },

arvore_genius_loci_NW is a manually defined ID, not a rotation or connection? I would ask if you can check EOCs checking for this location still function as expected. It should only be trimming _nw and not the capitalized version, but if it has unexpected changes I may need to consider a different approach.

I missed this in my GitHub feed so I’ll test this asap

@Maleclypse
Copy link
Member

@Maleclypse I'm vaguely concerned about how it will interact with this:

{ "u_at_om_location": "arvore_genius_loci_NW" },

arvore_genius_loci_NW is a manually defined ID, not a rotation or connection? I would ask if you can check EOCs checking for this location still function as expected. It should only be trimming _nw and not the capitalized version, but if it has unexpected changes I may need to consider a different approach.

So yes, it's a 4 square terrain where I named each square after it's relation to the center. The EOC works as expected in a current game. I'll compile your PR and test it as well.

@Maleclypse
Copy link
Member

Pulled your PR, compiled and set a message , { "u_message": "This EOC works still, tell Renech" } on the offending Arvore EOC. Tested it at Great Tree and at Arvore Genius loci. Received messaged at both locations. Looks like this works like a charm.

@Maleclypse Maleclypse merged commit 1ab5fb4 into CleverRaven:master Aug 30, 2024
43 of 44 checks passed
@RenechCDDA RenechCDDA deleted the oter_search_all_types branch August 30, 2024 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` EOC: Effects On Condition Anything concerning Effects On Condition Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions Map / Mapgen Overmap, Mapgen, Map extras, Map display Mechanics: Enchantments / Spells Enchantments and spells Mods: Magiclysm Anything to do with the Magiclysm mod Mods: Xedra Evolved Anything to do with Xedra Evolved Mods Issues related to mods or modding Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants