void construct::done_move(game *g, point p) { mvprintz(0, 0, c_red, "Press a direction for the furniture to move (. to cancel):"); int x = 0, y = 0; //Keep looping until we get a valid direction or a cancel. while(true){ do get_direction(g, x, y, input()); while (x == -2 || y == -2); if(x == 0 && y == 0) return; x += p.x; y += p.y; if(!able_empty(g, point(x, y))) { mvprintz(0, 0, c_red, "Can't move furniture there! Choose a direction with open floor."); continue; } break; } g->sound(x, y, furnlist[g->m.furn(p.x, p.y)].move_str_req * 2, "a scraping noise"); g->m.furn_set(x, y, g->m.furn(p.x, p.y)); g->m.furn_set(p.x, p.y, f_null); //Move all Items within a container std::vector <item> vItemMove = g->m.i_at(p.x, p.y); for (int i=0; i < vItemMove.size(); i++) g->m.add_item(x, y, vItemMove[i]); g->m.i_clear(p.x, p.y); }
bool construct::able_indoors(game *g, point p) { return g->m.has_flag(indoors, p.x, p.y) && able_empty(g, p); }
bool construct::able_make_window(game *g, point p) { return able_window(g, p) || able_empty(g, p); }