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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions data/json/mapgen/lumbermill.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"v 2 __________________________________",
"v vvvvv *___________________________1 1 ____",
"v vooov______________________ ____ 121 1 v",
"v voooV_____________ #.......# ____ 1 1*1 1 1 v",
"v voGoV_____________ #.......# ____ 1 1*1 1 1 v",
"v vooov_________ #L.....L#* ____* 1 1 1 2 v",
"v vvvvv ______ * *wL.....Lw ____1 1 1 1 *v",
"v 1____ 2 #L.....L# * ____1 1* 1 v",
Expand Down Expand Up @@ -111,8 +111,7 @@
],
"palettes": [ "lumberyard" ],
"terrain": { "o": "t_concrete" },
"place_terrain": [ { "ter": "t_gas_pump", "x": 4, "y": 39 } ],
"place_liquids": [ { "liquid": "gasoline", "x": 4, "y": 39, "repeat": [ 200, 1075 ] } ],
"gaspumps": { "G": { "fuel": "gasoline", "amount": [ 50000, 268750 ] } },
"place_vehicles": [
{ "vehicle": "flatbed_truck", "x": [ 43, 45 ], "y": 33, "chance": 30, "fuel": 25, "status": 1, "rotation": 90 },
{
Expand Down
4 changes: 2 additions & 2 deletions src/mapgen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -642,8 +642,8 @@ jmapgen_int::jmapgen_int( const JsonObject &jo, const std::string &tag )
}
}

jmapgen_int::jmapgen_int( const JsonObject &jo, const std::string &tag, const short def_val,
const short def_valmax )
jmapgen_int::jmapgen_int( const JsonObject &jo, const std::string &tag, const int &def_val,
const int &def_valmax )
: val( def_val )
, valmax( def_valmax )
{
Expand Down
9 changes: 5 additions & 4 deletions src/mapgen.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ class mapgen_function_builtin : public virtual mapgen_function
/////////////////////////////////////////////////////////////////////////////////
///// json mapgen (and friends)
/*
* Actually a pair of shorts that can rng, for numbers that will never exceed 32768
* Actually a pair of integers that can rng, for numbers that will never exceed INT_MAX
*/
struct jmapgen_int {
short val;
short valmax;
int val;
int valmax;
jmapgen_int( int v ) : val( v ), valmax( v ) {}
jmapgen_int( int v, int v2 ) : val( v ), valmax( v2 ) {}
jmapgen_int( point p );
Expand All @@ -74,7 +74,8 @@ struct jmapgen_int {
* Throws is the json is malformed (e.g. a string not an integer, but does not throw
* if the member is just missing (the default values are used instead).
*/
jmapgen_int( const JsonObject &jo, const std::string &tag, short def_val, short def_valmax );
jmapgen_int( const JsonObject &jo, const std::string &tag, const int &def_val,
const int &def_valmax );

int get() const;
};
Expand Down