From 728395caa7bb88994c0b210e458c69aefbcdfd73 Mon Sep 17 00:00:00 2001 From: Sylae Corell Date: Wed, 30 Jul 2014 12:08:10 -0600 Subject: [PATCH] removing unused variables --- Win32/game/boe.main.cpp | 3 +-- Win32/game/boe.monster.cpp | 17 +++++++---------- Win32/game/boe.party.cpp | 3 +-- Win32/game/boe.specials.cpp | 11 +++++------ Win32/game/boe.text.cpp | 4 ---- Win32/game/boe.town.cpp | 7 ++----- Win32/game/classes/pc.cpp | 3 +-- 7 files changed, 17 insertions(+), 31 deletions(-) diff --git a/Win32/game/boe.main.cpp b/Win32/game/boe.main.cpp index 24cb21f5..2bc65a97 100644 --- a/Win32/game/boe.main.cpp +++ b/Win32/game/boe.main.cpp @@ -308,7 +308,6 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR, int nCmd LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { - HDC hdc; PAINTSTRUCT ps; POINT press; HMENU menu; @@ -455,7 +454,7 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) if ((block_erase == true) && (hwnd == mainPtr)) { block_erase = false; } - hdc = BeginPaint(hwnd,&ps); + BeginPaint(hwnd,&ps); EndPaint(hwnd,&ps); if (hwnd != mainPtr) diff --git a/Win32/game/boe.monster.cpp b/Win32/game/boe.monster.cpp index 34910fbd..4e953462 100644 --- a/Win32/game/boe.monster.cpp +++ b/Win32/game/boe.monster.cpp @@ -236,7 +236,6 @@ void do_monsters() { short i,j,r1,target; location l1,l2; - Boolean acted_yet = false; if (overall_mode == MODE_TOWN) for (i = 0; i < T_M; i++) @@ -260,14 +259,13 @@ void do_monsters() if ((c_town.monst.dudes[i].active == 2) || ((c_town.monst.dudes[i].active != 0) && (c_town.monst.dudes[i].attitude % 2 != 1))) { - acted_yet = false; if (((c_town.monst.dudes[i].attitude == 0) || (monst_target[i] == 6)) && (c_town.hostile == 0)) { if (c_town.monst.dudes[i].mobile == true) { // OK, it doesn't see the party or // isn't nasty, and the town isn't totally hostile. if ((c_town.monst.dudes[i].attitude % 2 != 1) || (get_ran(1,0,1) == 0)) { - acted_yet = rand_move(i); + rand_move(i); } - else acted_yet = seek_party(i,c_town.monst.dudes[i].m_loc,c_town.p_loc); + else seek_party(i,c_town.monst.dudes[i].m_loc,c_town.p_loc); } } if ((c_town.monst.dudes[i].attitude > 0) || (c_town.hostile == 1)) { @@ -277,15 +275,15 @@ void do_monsters() if ((c_town.monst.dudes[i].m_d.morale < 0) && (c_town.monst.dudes[i].m_d.spec_skill != MONSTER_MINDLESS) && (c_town.monst.dudes[i].m_d.m_type != MONSTER_TYPE_UNDEAD)) { - acted_yet = flee_party(i,l1,l2); + flee_party(i,l1,l2); if (get_ran(1,0,10) < 6) c_town.monst.dudes[i].m_d.morale++; } else if (monst_hate_spot(i,&l2) == true) - acted_yet = seek_party(i,l1,l2); + seek_party(i,l1,l2); else if (((c_town.monst.dudes[i].m_d.mu == 0) && (c_town.monst.dudes[i].m_d.mu == 0)) || (can_see(l1,l2,0) > 3)) - acted_yet = seek_party(i,l1,l2); + seek_party(i,l1,l2); } } } @@ -317,14 +315,13 @@ void do_monsters() if (overall_mode == MODE_OUTDOORS) { for (i = 0; i < 10; i++) if (party.out_c[i].exists == true) { - acted_yet = false; l1 = party.out_c[i].m_loc; l2 = party.p_loc; r1 = get_ran(1,1,6); if (r1 == 3) - acted_yet = rand_move(i); - else acted_yet = seek_party(i,l1,l2); + rand_move(i); + else seek_party(i,l1,l2); } } } diff --git a/Win32/game/boe.party.cpp b/Win32/game/boe.party.cpp index 0786ccf7..437581bd 100644 --- a/Win32/game/boe.party.cpp +++ b/Win32/game/boe.party.cpp @@ -1574,7 +1574,7 @@ void do_priest_spell(short pc_num,short spell_num) //priest spells : 100 + spell number void cast_town_spell(location where) { - short adjust,r1,targ,store; + short adjust,r1,targ; location loc; unsigned char ter; @@ -1697,7 +1697,6 @@ void cast_town_spell(location where) update_explored(c_town.p_loc); } else { - store = get_ran(1,0,1); play_sound(41); add_string_to_buf(" Didn't work. "); } diff --git a/Win32/game/boe.specials.cpp b/Win32/game/boe.specials.cpp index 977dd2ac..59f57de7 100644 --- a/Win32/game/boe.specials.cpp +++ b/Win32/game/boe.specials.cpp @@ -93,7 +93,7 @@ Boolean check_special_terrain(location where_check,short mode,short which_pc,sho //short mode; // 0 - out 1 - town 2 - combat { unsigned char ter; - short r1,i,choice,door_pc,ter_special,ter_flag1,ter_flag2,dam_type = 0,pic_type = 0,ter_pic = 0; + short r1,i,choice,door_pc,ter_special,ter_flag1,ter_flag2,dam_type = 0,ter_pic = 0; Boolean can_enter = true; location out_where,from_loc,to_loc; short s1 = 0,s2 = 0,s3 = 0; @@ -253,7 +253,7 @@ Boolean check_special_terrain(location where_check,short mode,short which_pc,sho break; if (ter_special == TER_SPEC_DOES_FIRE_DAMAGE) { add_string_to_buf(" It's hot!"); - dam_type = DAMAGE_FIRE; pic_type = 0; + dam_type = DAMAGE_FIRE; if (party.stuff_done[SDF_LAVAWALK] > 0) { add_string_to_buf(" It doesn't affect you."); break; @@ -261,11 +261,11 @@ Boolean check_special_terrain(location where_check,short mode,short which_pc,sho } if (ter_special == TER_SPEC_DOES_COLD_DAMAGE) { add_string_to_buf(" You feel cold!"); - dam_type = DAMAGE_COLD; pic_type = 4; + dam_type = DAMAGE_COLD; } if (ter_special == TER_SPEC_DOES_MAGIC_DAMAGE) { add_string_to_buf(" Something shocks you!"); - dam_type = DAMAGE_MAGIC; pic_type = 1; + dam_type = DAMAGE_MAGIC; } r1 = get_ran(ter_flag2,dam_type,ter_flag1); if (mode < 2) @@ -449,7 +449,7 @@ void check_fields(location where_check,short mode,short which_pc) void use_item(short pc,short item) { Boolean take_charge = true,inept_ok = false; - short abil,level,i,j,item_use_code,str,type,which_stat,r1; + short abil,i,j,item_use_code,str,type,which_stat,r1; char to_draw[60]; location user_loc; //creature_data_type *which_m; @@ -463,7 +463,6 @@ effect_pat_type s = {{{0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0}}}; abil = adven[pc].items[item].ability; - level = adven[pc].items[item].item_level; item_use_code = abil_chart[abil]; if (item_use_code >= 10) { diff --git a/Win32/game/boe.text.cpp b/Win32/game/boe.text.cpp index 4215c22b..e7de9a72 100644 --- a/Win32/game/boe.text.cpp +++ b/Win32/game/boe.text.cpp @@ -41,12 +41,10 @@ void put_pc_screen() HDC hdc; COLORREF colors[6] = {RGB(0,0,0),RGB(255,0,0),RGB(128,0,0),RGB(0,160,0),RGB(0,0,255),RGB(255,255,255)}; HBITMAP store_bmp; - Boolean right_buttons_same = true; for (i = 0; i < 6; i++) if (((adven[i].main_status != MAIN_STATUS_ABSENT) && (pc_button_state[i] != 1)) || ((adven[i].main_status == MAIN_STATUS_ABSENT) && (pc_button_state[i] != 0))) - right_buttons_same = false; // First refresh gworld with the pc info //rect_draw_some_item (orig_pc_info_screen_gworld, erase_rect, pc_info_screen_gworld, erase_rect, 0, 0); @@ -1217,7 +1215,6 @@ void print_buf () short num_lines_printed = 0,ctrl_val; short line_to_print; short start_print_point; - Boolean end_loop = false; RECT store_text_rect = {0,0,256,138},dest_rect,erase_rect = {1,1,255,137}; /**/ RECT from_rect,to_rect; HDC hdc; @@ -1265,7 +1262,6 @@ void print_buf () } if ((num_lines_printed == LINES_IN_TEXT_WIN - 1) && (printing_long == true)) { - end_loop = false; line_to_print= buf_pointer; } diff --git a/Win32/game/boe.town.cpp b/Win32/game/boe.town.cpp index ecb1b745..4c17ec1f 100644 --- a/Win32/game/boe.town.cpp +++ b/Win32/game/boe.town.cpp @@ -34,7 +34,7 @@ void start_town_mode(short which_town, short entry_dir) char message[60]; short j,k,town_number; - short at_which_save_slot,former_town; + short former_town; location loc; unsigned char temp; Boolean monsters_loaded = false, town_toast = false; @@ -110,8 +110,6 @@ void start_town_mode(short which_town, short entry_dir) c_town.monst.which_town = town_number; c_town.monst.friendly = 0; - at_which_save_slot = party.at_which_save_slot; - for (i = 0; i < 4; i++) if (town_number == party.creature_save[i].which_town) { c_town.monst = party.creature_save[i]; @@ -1022,7 +1020,7 @@ void erase_specials() void erase_out_specials() { - short i,j,k,l,m,out_num; + short i,j,k,l,m; special_node_type sn; short sd1,sd2; @@ -1062,7 +1060,6 @@ void erase_out_specials() for (k = 0; k < 18; k++) //GK if (outdoors[i][j].special_id[k] >= 0) { - out_num = scenario.out_width * (party.outdoor_corner.y + j) + party.outdoor_corner.x + i; sn = outdoors[i][j].specials[outdoors[i][j].special_id[k]]; sd1 = sn.sd1; sd2 = sn.sd2; diff --git a/Win32/game/classes/pc.cpp b/Win32/game/classes/pc.cpp index f19ea18c..08ff7124 100644 --- a/Win32/game/classes/pc.cpp +++ b/Win32/game/classes/pc.cpp @@ -17,7 +17,7 @@ void pc_record_type::kill(short type) { short i = 24; - bool dummy, no_save = false, no_luck = false; + bool no_save = false, no_luck = false; location item_loc; if (type >= 20) @@ -62,7 +62,6 @@ void pc_record_type::kill(short type) if (overall_mode != MODE_OUTDOORS) for (i = 0; i < 24; i++) if (items[i].variety != ITEM_TYPE_NO_ITEM) { - dummy = place_item(items[i],item_loc,true); items[i].variety = ITEM_TYPE_NO_ITEM; } if ((type == 2) || (type == 3))