Skip to content

Commit 89410fe

Browse files
author
s.kushnirenko
committed
debug: moved killall command to console
1 parent 561e33b commit 89410fe

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

src/building/building_firehouse.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66

77
#include "dev/debug.h"
88

9+
declare_console_command_p(nofire, console_command_nofire);
910
static void console_command_nofire(std::istream &, std::ostream &) {
1011
buildings_valid_do([&] (building &b) {
1112
b.fire_risk = 0;
1213
});
1314
}
1415

15-
declare_console_command(nofire, console_command_nofire);
1616

1717
void building_firehouse::spawn_figure() {
1818
base.common_spawn_roamer(FIGURE_FIREMAN, 50, FIGURE_ACTION_70_FIREMAN_CREATED);
@@ -25,11 +25,11 @@ void building_firehouse::window_info_background(object_info &c) {
2525
outer_panel_draw(c.offset, c.width_blocks, c.height_blocks);
2626
lang_text_draw_centered(LANG_GROUP_ID, 0, c.offset.x, c.offset.y + 10, 16 * c.width_blocks, FONT_LARGE_BLACK_ON_LIGHT);
2727

28-
if (!c.has_road_access)
28+
if (!c.has_road_access) {
2929
window_building_draw_description(c, 69, 25);
30-
else if (!base.num_workers)
30+
} else if (!base.num_workers) {
3131
window_building_draw_description(c, LANG_GROUP_ID, 9);
32-
else {
32+
} else {
3333
if (base.has_figure(0))
3434
window_building_draw_description(c, LANG_GROUP_ID, 2);
3535
else

src/dev/debug.h

+1
Original file line numberDiff line numberDiff line change
@@ -100,5 +100,6 @@ struct console_var_int {
100100
};
101101

102102
#define declare_console_command(a, f) namespace console { bool cmd_##a; }; console_command a(#a, f);
103+
#define declare_console_command_p(a, f) namespace console { bool cmd_##a; }; void f(std::istream &, std::ostream &); console_command a(#a, f);
103104
#define declare_console_var_int(a, v) namespace console { bool var_##a; }; console_var_int a(#a, v);
104105

src/game/cheats.cpp

-7
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ static void game_cheat_start_invasion(pcstr);
3737
static void game_cheat_advance_year(pcstr);
3838
static void game_cheat_cast_blessing(pcstr);
3939
static void game_cheat_show_tooltip(pcstr);
40-
static void game_cheat_kill_all(pcstr);
4140
static void game_cheat_victory(pcstr);
4241
static void game_cheat_cast_upset(pcstr);
4342
static void game_cheat_start_plague(pcstr);
@@ -74,7 +73,6 @@ static cheat_command_handle g_cheat_commands[] = {{"startinvasion", game_cheat_s
7473
{"godupset", game_cheat_cast_upset},
7574
{"showtooltip", game_cheat_show_tooltip},
7675
{"startplague", game_cheat_start_plague},
77-
{"killall", game_cheat_kill_all},
7876
{"victory", game_cheat_victory},
7977
{"popmilestone", game_cheat_pop_milestone},
8078
{"fire", game_cheat_fire},
@@ -376,11 +374,6 @@ static void game_cheat_start_plague(pcstr args) {
376374
city_health_start_disease(total_population, true, plague_people);
377375
}
378376

379-
static void game_cheat_kill_all(pcstr args) {
380-
figure_kill_all();
381-
city_warning_show_console("Killed all walkers");
382-
}
383-
384377
void game_cheat_parse_command(pcstr command) {
385378
bstring256 command_to_call;
386379
int next_arg = parse_word(command, command_to_call);

0 commit comments

Comments
 (0)