Skip to content

Commit

Permalink
Merge pull request #46499 from BrettDong/gasoline
Browse files Browse the repository at this point in the history
Fix dirty gasoline spawned in lumber mills
  • Loading branch information
ZhilkinSerg authored Jan 3, 2021
2 parents d2b59f8 + de21a73 commit d859f82
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
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

0 comments on commit d859f82

Please sign in to comment.