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

Fix dirty gasoline spawned in lumber mills #46499

Merged
merged 2 commits into from
Jan 3, 2021

Conversation

BrettDong
Copy link
Member

Summary

SUMMARY: Bugfixes "Fix dirty gasoline obtained from gas pumps in lumber mills"

Purpose of change

Fix #46483. Gasoline spawned in gas pumps in lumber mills contain DIRTY flag and cannot be used to refill vehicles.

Describe the solution

In current implementation place_liquids is applied before setting terrain. Although t_gas_pump has LIQUIDCONT flag, when gasoline is placed, the terrain is not set yet, thus item::on_drop marks gasoline spilled DIRTY.

The solution used in this PR is to use gaspumps instead of place_liquids in mapgen JSON.

Describe alternatives you've considered

An alternative solution is to adjust the order of applying mapgen JSON fields in C++ code. But I am not sure if there will be any side effect.

Testing

Before applying this PR, gasoline spawned in lumber mills carry DIRTY flag. After applying this PR, spawn a new lumber mill, and observe that gasoline spawned is no longer DIRTY. Gasoline spawned here can also be used to refill vehicles without error.

@BrettDong BrettDong added [JSON] Changes (can be) made in JSON Map / Mapgen Overmap, Mapgen, Map extras, Map display [C++] Changes (can be) made in C++. Previously named `Code` <Bugfix> This is a fix for a bug (or closes open issue) labels Jan 2, 2021
@Hirmuolio
Copy link
Contributor

Hirmuolio commented Jan 2, 2021

Overmap terrain "s_gas" also has similar looking fuel placement. Maybe that too makes dirty fuel. It puts them inside furniture tanks instead of terrain in case that affects anything.

@BrettDong
Copy link
Member Author

Overmap terrain "s_gas" also has similar looking fuel placement. Maybe that too makes dirty fuel. It puts them inside furniture tanks instead of terrain in case that affects anything.

Gasoline placed inside gas tanks in gas stations is indeed still dirty, but it is not directly accessible by players. When the player hacks the gas station terminal, some amount of dirty gasoline in gas tanks is deducted and the same amount of clean gasoline is spawned in gas pumps. So at the player's end there is no problem.

@ZhilkinSerg ZhilkinSerg merged commit d859f82 into CleverRaven:master Jan 3, 2021
@PaulBlay
Copy link

PaulBlay commented Jan 3, 2021

Are there any other places that need checking? Like military helipad or airports?

@BrettDong BrettDong deleted the gasoline branch January 3, 2021 01:43
@BrettDong BrettDong added Spawn Creatures, items, vehicles, locations appearing on map and removed Map / Mapgen Overmap, Mapgen, Map extras, Map display labels Jan 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` [JSON] Changes (can be) made in JSON Spawn Creatures, items, vehicles, locations appearing on map
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Transfering gasoline from some sources to vehicle tanks isn't working
4 participants