Skip to content

Commit

Permalink
Make pedals only work if they are in the same square as the player.
Browse files Browse the repository at this point in the history
  • Loading branch information
ianestrachan committed Dec 1, 2013
1 parent fbbb07c commit 016f1a0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/vehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1600,10 +1600,14 @@ int vehicle::total_power (bool fueled)
{
int pwr = 0;
int cnt = 0;
int part_under_player;
g->m.veh_at(g->u.posx, g->u.posy, part_under_player);
bool player_controlling = player_in_control(&(g->u));
for (int p = 0; p < parts.size(); p++)
if (part_flag(p, "ENGINE") &&
(fuel_left (part_info(p).fuel_type, true) || !fueled ||
part_info(p).fuel_type == "muscle") &&
((part_info(p).fuel_type == "muscle") && player_controlling &&
part_with_feature(part_under_player, "ENGINE") == p)) &&
parts[p].hp > 0)
{
pwr += part_power(p);
Expand Down

0 comments on commit 016f1a0

Please sign in to comment.