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

Replace all fuel that spawns in military bases with jp8 #46824

Merged
merged 5 commits into from
Feb 6, 2021

Conversation

hexagonrecursion
Copy link
Contributor

@hexagonrecursion hexagonrecursion commented Jan 17, 2021

Summary

SUMMARY: Content "Switch fuel pumps in military bases from diesel to JP8"

Purpose of change

Fixes: #46746. Many of the cars inside of a mil base are filled with jp8 by default, but the pump only has diesel.

Describe the solution

Replace the fuel in the pump and jerrycans that spawn in a mil base with jp8.

Describe alternatives you've considered

Leave as is

Testing

  1. The game loads
  2. The pump in a military base contains jp8

Additional context

Currently blocked by this: no longer blocked

Cataclysm-DDA/src/mapgen.cpp

Lines 1091 to 1094 in 941d5fd

// may want to not force this, if we want to support other fuels for some reason
if( fuel != "gasoline" && fuel != "diesel" ) {
jsi.throw_error( "invalid fuel", "fuel" );
}

@BrettDong BrettDong added Spawn Creatures, items, vehicles, locations appearing on map [JSON] Changes (can be) made in JSON labels Jan 17, 2021
@Cyprex
Copy link

Cyprex commented Jan 19, 2021

Note that (one of the?) military helipads have a warehouse with 100L steel drums, of the ones that were filled I found 2 with JP8, one with diesel and one with gasoline, I guess this is nice to have?

@actual-nh
Copy link
Contributor

The above "Update mapgen.cpp" is to, well, hopefully fix the C++ code issue.

Update mapgen.cpp to allow jp8 fuel in pumps
@hexagonrecursion
Copy link
Contributor Author

@actual-nh

I tried it out. Now I get an error when visiting a military base (see below) and instead of a pump I get a puddle of jp8 where the pump should be.

DEBUG : invalid terrain id ""

FUNCTION : int_id generic_factory<ter_t>::convert(const string_id &, const int_id &, const bool) const [T = ter_t]
FILE : src/generic_factory.h
LINE : 467

@hexagonrecursion
Copy link
Contributor Author

I think I figured out why this happens: jp8 is missing pump_terrain:

{
"type": "material",
"id": "diesel",
"name": "Diesel",
"copy-from": "hydrocarbons",
"fuel_data": {
"energy": 35.8,
"pump_terrain": "t_diesel_pump",
"explosion_data": { "chance_hot": 20, "chance_cold": 1000, "factor": 0.2, "fiery": false, "size_factor": 0.1 }
}
},
{
"type": "material",
"id": "jp8",
"name": "JP8",
"copy-from": "hydrocarbons",
"fuel_data": {
"energy": 34.7,
"explosion_data": { "chance_hot": 20, "chance_cold": 1000, "factor": 0.2, "fiery": false, "size_factor": 0.1 }
}
},

@actual-nh
Copy link
Contributor

Looks like a new "t_jp8_pump" terrain is needed - probably just copy from the diesel variety.

@hexagonrecursion
Copy link
Contributor Author

Looks like a new "t_jp8_pump" terrain is needed - probably just copy from the diesel variety.

Done. Will push in a moment.

@hexagonrecursion hexagonrecursion marked this pull request as ready for review January 26, 2021 15:13
"id": "t_jp8_pump",
"name": "JP8 pump",
"looks_like": "t_gas_pump",
"description": "This pump is filled with JP8. If this gas dispenser doesn't give up the goods for free, you may have to pay at a nearby terminal.",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"description": "This pump is filled with JP8. If this gas dispenser doesn't give up the goods for free, you may have to pay at a nearby terminal.",
"description": "This pump is filled with JP8. If this gas dispenser doesn't give up the goods for free, you may have to pay at a nearby terminal.",

Is this actually true of military bases and pumps meant for military vehicles, BTW (the charging)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this actually true of military bases and pumps meant for military vehicles, BTW (the charging)?

It does not look like it is. I was thinking this pump might at some point be added in other places.

Co-authored-by: actual-nh <74678550+actual-nh@users.noreply.github.com>
@kevingranade kevingranade merged commit 5a0df98 into CleverRaven:master Feb 6, 2021
@hexagonrecursion hexagonrecursion deleted the mil-jp8 branch February 6, 2021 06:07
@kevingranade
Copy link
Member

This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there:

https://discourse.cataclysmdda.org/t/no-hope-mod-v2-1/24971/22

feinorgh pushed a commit to feinorgh/Cataclysm-DDA that referenced this pull request Feb 8, 2021
…46824)

* Replace all fuel that spawns in mil bases with jp8
* Update mapgen.cpp to allow jp8 fuel in pumps
* Fix jp8 missing pump_terrain
Co-authored-by: actual-nh <74678550+actual-nh@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[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.

Pump in military base has wrong fuel
6 participants