Skip to content

Commit

Permalink
Merge pull request #24 from wito/master
Browse files Browse the repository at this point in the history
Some new vehicle parts
  • Loading branch information
TheDarklingWolf committed Jan 29, 2013
2 parents 5898a2a + 21c9237 commit 77d2a3a
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 7 deletions.
Empty file modified crafting.cpp
100755 → 100644
Empty file.
Empty file modified crafting.h
100755 → 100644
Empty file.
3 changes: 2 additions & 1 deletion player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4538,7 +4538,8 @@ void player::try_to_sleep(game *g)
vehicle *veh = g->m.veh_at (posx, posy, vpart);
if (g->m.ter(posx, posy) == t_bed || g->m.ter(posx, posy) == t_makeshift_bed ||
g->m.tr_at(posx, posy) == tr_cot || g->m.tr_at(posx, posy) == tr_rollmat ||
veh && veh->part_with_feature (vpart, vpf_seat) >= 0)
veh && veh->part_with_feature (vpart, vpf_seat) >= 0 ||
veh && veh->part_with_feature (vpart, vpf_bed) >= 0)
g->add_msg("This is a comfortable place to sleep.");
else if (g->m.ter(posx, posy) != t_floor)
g->add_msg("It's %shard to get to sleep on this %s.",
Expand Down
9 changes: 8 additions & 1 deletion veh_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ enum vpart_id

// external parts
vp_seat,
vp_bed,
vp_frame_h,
vp_frame_v,
vp_frame_c,
Expand All @@ -34,6 +35,7 @@ enum vpart_id
vp_roof,
vp_door,
vp_door_o,
vp_door_i,
vp_window,
vp_blade_h,
vp_blade_v,
Expand Down Expand Up @@ -97,6 +99,7 @@ enum vpart_flags
vpf_roof, // is a roof (cover)
vpf_wheel, // this part touches ground (trigger traps)
vpf_seat, // is seat
vpf_bed, // is bed (like seat, but can't be boarded)
vpf_engine, // is engine
vpf_fuel_tank, // is fuel tank
vpf_cargo, // is cargo
Expand Down Expand Up @@ -148,6 +151,8 @@ const vpart_info vpart_list[num_vparts] =
0 },
{ "seat", '#', c_red, '*', c_red, 60, 300, 0, 0, itm_seat, 1,
mfb(vpf_over) | mfb(vpf_seat) | mfb(vpf_no_reinforce) },
{ "bed", '#', c_magenta, '*', c_magenta, 60, 300, 0, 0, itm_seat, 1,
mfb(vpf_over) | mfb(vpf_bed) | mfb(vpf_no_reinforce) },
{ "frame", 'h', c_ltgray, '#', c_ltgray, 100, 400, 0, 0, itm_frame, 1,
mfb(vpf_external) | mfb(vpf_mount_point) | mfb (vpf_mount_inner) },
{ "frame", 'j', c_ltgray, '#', c_ltgray, 100, 400, 0, 0, itm_frame, 1,
Expand Down Expand Up @@ -187,7 +192,9 @@ const vpart_info vpart_list[num_vparts] =
{ "door", '+', c_cyan, '&', c_cyan, 80, 200, 0, 0, itm_frame, 2,
mfb(vpf_external) | mfb(vpf_obstacle) | mfb(vpf_openable) },
{ "opaque door",'+', c_cyan, '&', c_cyan, 80, 200, 0, 0, itm_frame, 2,
mfb(vpf_external) | mfb(vpf_obstacle) | mfb(vpf_openable) },
mfb(vpf_external) | mfb(vpf_obstacle) | mfb(vpf_opaque) | mfb(vpf_openable) },
{ "internal door", '+', c_cyan, '&', c_cyan, 75, 75, 0, 0, itm_frame, 2,
mfb(vpf_external) | mfb(vpf_obstacle) | mfb(vpf_opaque) | mfb(vpf_openable) | mfb(vpf_roof) | mfb(vpf_no_reinforce) },
{ "windshield", '"', c_ltcyan, '0', c_ltgray, 70, 50, 0, 0, itm_glass_sheet, 1,
mfb(vpf_over) | mfb(vpf_obstacle) | mfb(vpf_no_reinforce) },
{ "blade", '-', c_white, 'x', c_white, 250, 100, 0, 0, itm_carblade, 2,
Expand Down
8 changes: 4 additions & 4 deletions veh_typedef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,20 +247,20 @@ void game::init_vehicles()
PART (0, 0, vp_cargo_box);
PART (0, 0, vp_roof);
PART (0, 1, vp_frame_v2);
PART (0, 1, vp_seat);
PART (0, 1, vp_bed);
PART (0, 1, vp_roof);
PART (0, -1, vp_frame_v2);
PART (0, -1, vp_cargo_box);
PART (0, -1, vp_roof);
PART (0, 2, vp_board_v);
PART (0, 2, vp_fuel_tank_gas);
PART (0, -2, vp_frame_v2);
PART (0, -2, vp_seat);
PART (0, -2, vp_bed);
PART (0, -2, vp_roof);
PART (0, -3, vp_board_v);
PART (0, -3, vp_fuel_tank_gas);

PART (1, 0, vp_door_o);
PART (1, 0, vp_door_i);
PART (1, -1, vp_board_h);
PART (1, 1, vp_board_h);
PART (1, -2, vp_board_h);
Expand All @@ -273,7 +273,7 @@ void game::init_vehicles()
PART (-1, 1, vp_board_h);
PART (-1, -1, vp_board_h);
PART (-1, -2, vp_board_h);
PART (-1, 2, vp_board_b);
PART (-1, 2, vp_board_n);
PART (-1, -3, vp_board_b);

PART (2, -1, vp_frame_h);
Expand Down
2 changes: 1 addition & 1 deletion vehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1575,7 +1575,7 @@ void vehicle::refresh_insides ()
else
if (part_flag(pn, vpf_obstacle))
{ // found an obstacle, like board or windshield or door
if (part_flag(pn, vpf_openable) && parts[pn].open)
if (parts[pn].inside || part_flag(pn, vpf_openable) && parts[pn].open)
continue; // door and it's open -- can't cover
cover = true;
break;
Expand Down

0 comments on commit 77d2a3a

Please sign in to comment.