Skip to content

Commit c01b353

Browse files
authored
Merge pull request #81191 from RenechCDDA/revert_vehicle_size_changes
Revert vehicle cargo sizes to sane values
2 parents 172d914 + 4b9be24 commit c01b353

File tree

5 files changed

+8
-127
lines changed

5 files changed

+8
-127
lines changed

data/json/vehicleparts/doors.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@
138138
},
139139
"repair": { "skills": [ [ "mechanics", 3 ] ], "time": "5 m", "using": [ [ "repair_welding_lc_steel", 3 ] ] }
140140
},
141-
"size": "200 L",
141+
"size": "37500 ml",
142142
"extend": { "flags": [ "LOCKABLE_CARGO", "MULTISQUARE", "COVERED" ] },
143143
"type": "vehicle_part"
144144
},
@@ -176,7 +176,6 @@
176176
},
177177
"repair": { "skills": [ [ "mechanics", 4 ] ], "time": "8 m", "using": [ [ "repair_welding_lc_steel", 4 ] ] }
178178
},
179-
"size": "100 L",
180179
"type": "vehicle_part"
181180
},
182181
{

data/json/vehicleparts/seats.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"using": [ [ "repair_welding_standard", 1 ], [ "sewing_standard", 8 ] ]
5050
}
5151
},
52-
"size": "85 L",
52+
"size": "25 L",
5353
"type": "vehicle_part",
5454
"variants_bases": [ { "id": "windshield", "label": "Windshield" }, { "id": "swivel_chair", "label": "Swivel Chair" } ],
5555
"variants": [
@@ -76,10 +76,9 @@
7676
"id": "reclining_seat",
7777
"copy-from": "seat",
7878
"comfort": 3,
79-
"//": "reclining and bench seats are roomier than standard and are able to fit Large characters, if not comfortably",
8079
"description": "A soft seat with an adjustable backrest, making it a reasonably comfortable place to sleep.",
8180
"durability": 100,
82-
"size": "95 L",
81+
"size": "6250 ml",
8382
"floor_bedding_warmth": 350,
8483
"name": { "str": "reclining bucket seat" },
8584
"extend": { "flags": [ "BED" ] },
@@ -103,7 +102,6 @@
103102
"description": "A soft, wide seat with a high back, the kind often used in back seats or older cars. It might be a decent place to sleep.",
104103
"floor_bedding_warmth": 500,
105104
"item": "seat_bench",
106-
"size": "95 L",
107105
"name": { "str": "bench seat" },
108106
"extend": { "flags": [ "BED" ] },
109107
"type": "vehicle_part"

data/json/vehicleparts/vehicle_parts.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@
207207
"damage_modifier": 60,
208208
"durability": 95,
209209
"description": "A small but comfortable bed.",
210-
"size": "100 L",
210+
"size": "50 L",
211211
"item": "mattress",
212212
"comfort": 4,
213213
"floor_bedding_warmth": 700,
@@ -309,7 +309,6 @@
309309
"color": "white",
310310
"durability": 400,
311311
"description": "An aisle.",
312-
"size": "100 L",
313312
"item": "sheet_metal",
314313
"location": "center",
315314
"//": ".5 m square sheet of metal, likely affixed with bolts in places, assume 200 cm weld to install and 50 cm weld to repair",
@@ -326,7 +325,7 @@
326325
},
327326
"repair": { "skills": [ [ "mechanics", 2 ] ], "time": "6 m", "using": [ [ "repair_welding_lc_steel", 5 ] ] }
328327
},
329-
"flags": [ "AISLE", "BOARDABLE", "CARGO" ],
328+
"flags": [ "AISLE", "BOARDABLE" ],
330329
"breaks_into": [
331330
{ "item": "sheet_metal_small", "count": [ 0, 1 ] },
332331
{ "item": "lc_steel_lump", "count": [ 1, 2 ] },
@@ -366,7 +365,7 @@
366365
"folded_volume": "12500 ml",
367366
"item": "foldwoodframe",
368367
"breaks_into": [ { "item": "splinter", "count": [ 7, 11 ] }, { "item": "nail", "charges": [ 5, 10 ] } ],
369-
"flags": [ "AISLE", "BOARDABLE", "CARGO" ]
368+
"flags": [ "AISLE", "BOARDABLE" ]
370369
},
371370
{
372371
"type": "vehicle_part",
@@ -2294,8 +2293,7 @@
22942293
"durability": 250,
22952294
"description": "A cargo space for carrying livestock. 'e'xamine it to capture an animal next to you, or to release the animal currently contained. When selecting an animal to capture, choose its tile relative to you, not the part.",
22962295
"//1": "240 cm weld to install, 60 cm per damage quadrant to repair",
2297-
"size": "300 L",
2298-
"comfort": 2,
2296+
"size": "200 L",
22992297
"item": "livestock_carrier",
23002298
"location": "center",
23012299
"requirements": {
@@ -2311,7 +2309,7 @@
23112309
},
23122310
"repair": { "skills": [ [ "mechanics", 2 ] ], "time": "20 m", "using": [ [ "repair_welding_standard", 12 ] ] }
23132311
},
2314-
"flags": [ "BOARDABLE", "CARGO", "COVERED", "CAPTURE_MONSTER_VEH", "HUGE_OK", "BED", "BELTABLE" ],
2312+
"flags": [ "BOARDABLE", "CARGO", "COVERED", "CAPTURE_MONSTER_VEH", "HUGE_OK" ],
23152313
"breaks_into": [
23162314
{ "item": "mc_steel_lump", "count": [ 6, 8 ] },
23172315
{ "item": "mc_steel_chunk", "count": [ 6, 8 ] },

data/mods/TEST_DATA/vehicle.json

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -500,50 +500,5 @@
500500
{ "x": -1, "y": 1, "parts": [ "frame#horizontal_rear", "halfboard#horizontal_2_rear" ] },
501501
{ "x": -1, "y": 2, "parts": [ "frame#se", "halfboard#hatch_wheel_right", "wheel_mount_medium", "wheel" ] }
502502
]
503-
},
504-
{
505-
"id": "character_volume_test_car",
506-
"type": "vehicle",
507-
"name": "DEBUG volume test car DEBUG",
508-
"blueprint": [
509-
[ "=====" ],
510-
[ "=====" ],
511-
[ "=====" ],
512-
[ "=====" ],
513-
[ "=====" ]
514-
],
515-
"parts": [
516-
{ "x": -1, "y": -1, "parts": [ "frame", "aisle", "roof" ] },
517-
{ "x": 0, "y": -1, "parts": [ "frame", "aisle", "roof" ] },
518-
{ "x": 1, "y": -1, "parts": [ "frame", "aisle", "roof" ] },
519-
{ "x": -1, "y": 0, "parts": [ "frame", "aisle", "roof" ] },
520-
{ "x": 0, "y": 0, "parts": [ "frame", "aisle", "roof" ] },
521-
{ "x": 1, "y": 0, "parts": [ "frame", "aisle", "roof" ] },
522-
{ "x": -1, "y": 1, "parts": [ "frame", "aisle", "roof" ] },
523-
{ "x": 0, "y": 1, "parts": [ "frame", "aisle", "roof" ] },
524-
{ "x": 1, "y": 1, "parts": [ "frame", "aisle", "roof" ] },
525-
{ "x": -1, "y": 2, "parts": [ "frame", "aisle", "roof" ] },
526-
{ "x": 0, "y": 2, "parts": [ "frame", "aisle", "roof" ] },
527-
{ "x": 1, "y": 2, "parts": [ "frame", "aisle", "roof" ] },
528-
{ "x": 2, "y": 2, "parts": [ "frame", "aisle", "roof" ] },
529-
{ "x": 0, "y": -2, "parts": [ "frame", "aisle", "roof" ] },
530-
{ "x": 1, "y": -2, "parts": [ "frame", "aisle", "roof" ] },
531-
{ "x": 2, "y": -1, "parts": [ "frame", "aisle", "roof" ] },
532-
{ "x": 2, "y": 0, "parts": [ "frame", "aisle", "roof" ] },
533-
{ "x": 2, "y": 1, "parts": [ "frame", "aisle", "roof" ] },
534-
{ "x": -2, "y": -1, "parts": [ "frame", "aisle", "roof" ] },
535-
{ "x": -2, "y": 0, "parts": [ "frame", "aisle", "roof" ] },
536-
{ "x": -2, "y": -2, "parts": [ "frame", "aisle", "roof" ] },
537-
{ "x": -1, "y": -2, "parts": [ "frame", "aisle", "roof" ] },
538-
{ "x": 2, "y": -2, "parts": [ "frame", "aisle", "roof" ] },
539-
{ "x": -2, "y": 2, "parts": [ "frame", "aisle", "roof" ] },
540-
{ "x": -2, "y": 1, "parts": [ "frame", "aisle", "roof" ] }
541-
],
542-
"items": [
543-
{ "x": 1, "y": 0, "chance": 100, "items": [ "rock_volume_test" ] },
544-
{ "x": -1, "y": 0, "chance": 100, "items": [ "rock_volume_test" ] },
545-
{ "x": 0, "y": 1, "chance": 100, "items": [ "rock_volume_test" ] },
546-
{ "x": 0, "y": -1, "chance": 100, "items": [ "rock_volume_test" ] }
547-
]
548503
}
549504
]

tests/char_volume_test.cpp

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,15 @@
22

33
#include "cata_catch.h"
44
#include "character.h"
5-
#include "coordinates.h"
6-
#include "item.h"
7-
#include "map.h"
8-
#include "map_helpers.h"
95
#include "player_helpers.h"
10-
#include "point.h"
116
#include "type_id.h"
127
#include "units.h"
13-
#include "vpart_position.h"
14-
15-
static const itype_id itype_backpack_giant( "backpack_giant" );
16-
static const itype_id itype_rock_volume_test( "rock_volume_test" );
178

189
static const trait_id trait_HUGE( "HUGE" );
1910
static const trait_id trait_LARGE( "LARGE" );
2011
static const trait_id trait_SMALL( "SMALL" );
2112
static const trait_id trait_SMALL2( "SMALL2" );
2213

23-
static const vproto_id vehicle_prototype_character_volume_test_car( "character_volume_test_car" );
24-
2514
static units::volume your_volume_with_trait( trait_id new_trait )
2615
{
2716
clear_avatar();
@@ -60,61 +49,3 @@ TEST_CASE( "character_baseline_volumes", "[volume]" )
6049
REQUIRE( your_height_with_trait( trait_HUGE ) == 280 );
6150
CHECK( your_volume_with_trait( trait_HUGE ) == 156228_ml );
6251
}
63-
64-
TEST_CASE( "character_at_volume_will_be_cramped_in_vehicle", "[volume]" )
65-
{
66-
clear_avatar();
67-
clear_map();
68-
map &here = get_map();
69-
Character &you = get_player_character();
70-
REQUIRE( you.get_mutations().empty() );
71-
72-
tripoint_bub_ms test_pos {10, 10, 0 };
73-
74-
75-
clear_vehicles(); // extra safety
76-
here.add_vehicle( vehicle_prototype_character_volume_test_car, test_pos, 0_degrees, 0, 0 );
77-
you.setpos( here, test_pos );
78-
const optional_vpart_position vp_there = here.veh_at( you.pos_bub( here ) );
79-
REQUIRE( vp_there );
80-
tripoint_abs_ms dest_loc = you.pos_abs();
81-
82-
// Empty aisle
83-
dest_loc = dest_loc + tripoint::north_west;
84-
CHECK( !you.will_be_cramped_in_vehicle_tile( here, dest_loc ) );
85-
dest_loc = you.pos_abs(); //reset
86-
87-
// Aisle with 10L rock, a tight fit but not impossible
88-
dest_loc = dest_loc + tripoint::north;
89-
CHECK( you.will_be_cramped_in_vehicle_tile( here, dest_loc ) );
90-
dest_loc = you.pos_abs(); //reset
91-
92-
// Empty aisle, but we've put on a backpack and a 10L rock in that backpack
93-
item backpack( itype_backpack_giant );
94-
auto worn_success = you.wear_item( backpack );
95-
CHECK( worn_success );
96-
you.i_add( item( itype_rock_volume_test ) );
97-
CHECK( 75_liter <= you.get_total_volume() );
98-
CHECK( you.get_total_volume() <= 100_liter );
99-
dest_loc = dest_loc + tripoint::north_west;
100-
CHECK( you.will_be_cramped_in_vehicle_tile( here, dest_loc ) );
101-
dest_loc = you.pos_abs(); //reset
102-
103-
// Try the cramped aisle with a rock again, but now we are tiny, so it is easy.
104-
CHECK( your_volume_with_trait( trait_SMALL2 ) == 23326_ml );
105-
you.setpos( here, test_pos ); // set our position again, clear_avatar() moved us
106-
dest_loc = dest_loc + tripoint::north;
107-
CHECK( !you.will_be_cramped_in_vehicle_tile( here, dest_loc ) );
108-
dest_loc = you.pos_abs(); //reset
109-
110-
// Same aisle, but now we have HUGE GUTS. We will never fit.
111-
CHECK( your_volume_with_trait( trait_HUGE ) == 156228_ml );
112-
you.setpos( here, test_pos ); // set our position again, clear_avatar() moved us
113-
dest_loc = dest_loc + tripoint::north;
114-
CHECK( you.will_be_cramped_in_vehicle_tile( here, dest_loc ) );
115-
dest_loc = you.pos_abs(); //reset
116-
117-
// And finally, check that our HUGE body won't fit even into an empty aisle.
118-
dest_loc = dest_loc + tripoint::north_west;
119-
CHECK( you.will_be_cramped_in_vehicle_tile( here, dest_loc ) );
120-
}

0 commit comments

Comments
 (0)