Skip to content

Commit

Permalink
Removing very weird and useless loop (found by Coverity Scan).
Browse files Browse the repository at this point in the history
  • Loading branch information
marzojr committed Nov 22, 2016
1 parent 5ec5dc3 commit 2b2bf45
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions schedule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2442,7 +2442,7 @@ bool Sit_schedule::set_action(

Desk_schedule::Desk_schedule(
Actor *n
) : Schedule(n), chair(0), desk(0), table(0), desk_item(0),
) : Schedule(n), chair(0), desk(0), table(0), desk_item(0),
items_in_hand(0), state(desk_setup) {
}

Expand Down Expand Up @@ -2603,7 +2603,7 @@ void Desk_schedule::now_what(
desk = npc->find_closest(desks, 2);
if (desk) {
static int chairs[] = {873, 292};
chair = desk->find_closest(chairs,
chair = desk->find_closest(chairs,
sizeof(chairs) / sizeof(chairs[0]));
}
if (!chair) { // Failed.
Expand All @@ -2614,7 +2614,7 @@ void Desk_schedule::now_what(
add_client(chair);
state = sit_at_desk;
}
/* FALL THROUGH */
/* FALL THROUGH */
case sit_at_desk: {
int frnum = npc->get_framenum();
// Not sitting?
Expand Down Expand Up @@ -2664,7 +2664,7 @@ void Desk_schedule::now_what(
state = sit_at_desk; // Back to desk.
} else if (rand() % 4) { // Put down an item.
Game_object_vector items;
int nitems = npc->get_objects(items, 675,
int nitems = npc->get_objects(items, 675,
c_any_qual, c_any_framenum);
items_in_hand = nitems; // Save value.
if (nitems) {
Expand All @@ -2680,7 +2680,7 @@ void Desk_schedule::now_what(
: foot.y + foot.h - 1;
Shape_info &info = table->get_info();
spot.tz = table->get_lift() + info.get_3d_height();
Tile_coord pos = Map_chunk::find_spot(spot, 1,
Tile_coord pos = Map_chunk::find_spot(spot, 1,
to_drop->get_shapenum(), to_drop->get_framenum());
if (pos.tx != -1 && pos.tz == spot.tz &&
foot.has_world_point(pos.tx, pos.ty)) {
Expand Down Expand Up @@ -4106,13 +4106,12 @@ void Bake_schedule::now_what() {
break;
}
clearing = true;
for (size_t i = 0; i < food.size(); i++) {
if (food.size()) {
delay = 500;
state = remove_food;
break;
}
if (!food.size())
} else {
state = display_wares;
}
break;
}
case remove_food: { // Delete food on display table one by one with a slight delay
Expand Down

0 comments on commit 2b2bf45

Please sign in to comment.