Skip to content

Conversation

@MilosRasic
Copy link
Contributor

Summary

Mods "Fix Aftershock UICA vehicle purchase"

Purpose of change

Fixes #83445

Describe the solution

The bug is fixed by removing the vehicle, then placing it back with player faction as the owner as a separate mapgen update.

Describe alternatives you've considered

  • The issue suggests setting the vehicle area to be owned by the player faction. It's not my favourite solution becuase if the player found some way to get into the garage without paying for the vehicle and otherwise angering UICA, they'd be free to take the vehicle as if it were theirs.
  • At first, I searched for an effect that would simply set the owner of the existing vehicle, but I didn't find one.
  • My next idea was to remove and place the vehicle in the same mapgen update, but that doesn't work because collision maps are not updated between effects, so after remove_vehicles, when place_vehicles checks for collisions it's not aware that the vehicle is going to be removed, so the whole mapgen update bails.

Testing

Loaded the game, bought the vehicle, and verified that it's owned by Your Followers. Took it for a spin just to make sure.

Additional context

none

@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 Vehicles Vehicles, parts, mechanics & interactions Mods: Aftershock Anything to do with the Aftershock mod <Bugfix> This is a fix for a bug (or closes open issue) labels Nov 7, 2025
"effect": [
{ "npc_add_var": "player_has_bought_car", "value": "yes" },
{ "mapgen_update": "afs_shuttlepad_salvors_garage_open", "om_terrain": "afs_shuttlepad_salvors_a1_1" }
{ "mapgen_update": [ "afs_shuttlepad_salvors_garage_open_and_remove_lynx", "afs_shuttlepad_salvors_garage_place_lynx" ], "om_terrain": "afs_shuttlepad_salvors_a1_1" }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JSON & C++ formatters] reported by reviewdog 🐶

Suggested change
{ "mapgen_update": [ "afs_shuttlepad_salvors_garage_open_and_remove_lynx", "afs_shuttlepad_salvors_garage_place_lynx" ], "om_terrain": "afs_shuttlepad_salvors_a1_1" }
{
"mapgen_update": [ "afs_shuttlepad_salvors_garage_open_and_remove_lynx", "afs_shuttlepad_salvors_garage_place_lynx" ],
"om_terrain": "afs_shuttlepad_salvors_a1_1"
}

@github-actions github-actions bot added the astyled astyled PR, label is assigned by github actions label Nov 7, 2025
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 <Bugfix> This is a fix for a bug (or closes open issue) [JSON] Changes (can be) made in JSON Map / Mapgen Overmap, Mapgen, Map extras, Map display Mods: Aftershock Anything to do with the Aftershock mod Mods Issues related to mods or modding Vehicles Vehicles, parts, mechanics & interactions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Aftershock] Lynx Explorer is owned by UICA after purchasing

1 participant