removing unused variables

This commit is contained in:
Sylae Corell
2014-07-30 12:08:10 -06:00
parent f839ef7d7a
commit 728395caa7
7 changed files with 17 additions and 31 deletions

View File

@@ -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) LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
HDC hdc;
PAINTSTRUCT ps; PAINTSTRUCT ps;
POINT press; POINT press;
HMENU menu; HMENU menu;
@@ -455,7 +454,7 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
if ((block_erase == true) && (hwnd == mainPtr)) { if ((block_erase == true) && (hwnd == mainPtr)) {
block_erase = false; block_erase = false;
} }
hdc = BeginPaint(hwnd,&ps); BeginPaint(hwnd,&ps);
EndPaint(hwnd,&ps); EndPaint(hwnd,&ps);
if (hwnd != mainPtr) if (hwnd != mainPtr)

View File

@@ -236,7 +236,6 @@ void do_monsters()
{ {
short i,j,r1,target; short i,j,r1,target;
location l1,l2; location l1,l2;
Boolean acted_yet = false;
if (overall_mode == MODE_TOWN) if (overall_mode == MODE_TOWN)
for (i = 0; i < T_M; i++) for (i = 0; i < T_M; i++)
@@ -260,14 +259,13 @@ void do_monsters()
if ((c_town.monst.dudes[i].active == 2) if ((c_town.monst.dudes[i].active == 2)
|| ((c_town.monst.dudes[i].active != 0) && (c_town.monst.dudes[i].attitude % 2 != 1))) { || ((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].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 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. // 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)) { 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)) { 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) 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)) { && (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) if (get_ran(1,0,10) < 6)
c_town.monst.dudes[i].m_d.morale++; c_town.monst.dudes[i].m_d.morale++;
} }
else if (monst_hate_spot(i,&l2) == true) 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)) 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)) || (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) { if (overall_mode == MODE_OUTDOORS) {
for (i = 0; i < 10; i++) for (i = 0; i < 10; i++)
if (party.out_c[i].exists == true) { if (party.out_c[i].exists == true) {
acted_yet = false;
l1 = party.out_c[i].m_loc; l1 = party.out_c[i].m_loc;
l2 = party.p_loc; l2 = party.p_loc;
r1 = get_ran(1,1,6); r1 = get_ran(1,1,6);
if (r1 == 3) if (r1 == 3)
acted_yet = rand_move(i); rand_move(i);
else acted_yet = seek_party(i,l1,l2); else seek_party(i,l1,l2);
} }
} }
} }

View File

@@ -1574,7 +1574,7 @@ void do_priest_spell(short pc_num,short spell_num)
//priest spells : 100 + spell number //priest spells : 100 + spell number
void cast_town_spell(location where) void cast_town_spell(location where)
{ {
short adjust,r1,targ,store; short adjust,r1,targ;
location loc; location loc;
unsigned char ter; unsigned char ter;
@@ -1697,7 +1697,6 @@ void cast_town_spell(location where)
update_explored(c_town.p_loc); update_explored(c_town.p_loc);
} }
else { else {
store = get_ran(1,0,1);
play_sound(41); play_sound(41);
add_string_to_buf(" Didn't work. "); add_string_to_buf(" Didn't work. ");
} }

View File

@@ -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 //short mode; // 0 - out 1 - town 2 - combat
{ {
unsigned char ter; 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; Boolean can_enter = true;
location out_where,from_loc,to_loc; location out_where,from_loc,to_loc;
short s1 = 0,s2 = 0,s3 = 0; 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; break;
if (ter_special == TER_SPEC_DOES_FIRE_DAMAGE) { if (ter_special == TER_SPEC_DOES_FIRE_DAMAGE) {
add_string_to_buf(" It's hot!"); 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) { if (party.stuff_done[SDF_LAVAWALK] > 0) {
add_string_to_buf(" It doesn't affect you."); add_string_to_buf(" It doesn't affect you.");
break; 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) { if (ter_special == TER_SPEC_DOES_COLD_DAMAGE) {
add_string_to_buf(" You feel cold!"); 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) { if (ter_special == TER_SPEC_DOES_MAGIC_DAMAGE) {
add_string_to_buf(" Something shocks you!"); 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); r1 = get_ran(ter_flag2,dam_type,ter_flag1);
if (mode < 2) 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) void use_item(short pc,short item)
{ {
Boolean take_charge = true,inept_ok = false; 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]; char to_draw[60];
location user_loc; location user_loc;
//creature_data_type *which_m; //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},
{0,0,0,0,0,0,0,0,0}}}; {0,0,0,0,0,0,0,0,0}}};
abil = adven[pc].items[item].ability; abil = adven[pc].items[item].ability;
level = adven[pc].items[item].item_level;
item_use_code = abil_chart[abil]; item_use_code = abil_chart[abil];
if (item_use_code >= 10) { if (item_use_code >= 10) {

View File

@@ -41,12 +41,10 @@ void put_pc_screen()
HDC hdc; 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)}; 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; HBITMAP store_bmp;
Boolean right_buttons_same = true;
for (i = 0; i < 6; i++) for (i = 0; i < 6; i++)
if (((adven[i].main_status != MAIN_STATUS_ABSENT) && (pc_button_state[i] != 1)) || 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))) ((adven[i].main_status == MAIN_STATUS_ABSENT) && (pc_button_state[i] != 0)))
right_buttons_same = false;
// First refresh gworld with the pc info // 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); //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 num_lines_printed = 0,ctrl_val;
short line_to_print; short line_to_print;
short start_print_point; 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 store_text_rect = {0,0,256,138},dest_rect,erase_rect = {1,1,255,137}; /**/
RECT from_rect,to_rect; RECT from_rect,to_rect;
HDC hdc; HDC hdc;
@@ -1265,7 +1262,6 @@ void print_buf ()
} }
if ((num_lines_printed == LINES_IN_TEXT_WIN - 1) && (printing_long == true)) { if ((num_lines_printed == LINES_IN_TEXT_WIN - 1) && (printing_long == true)) {
end_loop = false;
line_to_print= buf_pointer; line_to_print= buf_pointer;
} }

View File

@@ -34,7 +34,7 @@ void start_town_mode(short which_town, short entry_dir)
char message[60]; char message[60];
short j,k,town_number; short j,k,town_number;
short at_which_save_slot,former_town; short former_town;
location loc; location loc;
unsigned char temp; unsigned char temp;
Boolean monsters_loaded = false, town_toast = false; 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.which_town = town_number;
c_town.monst.friendly = 0; c_town.monst.friendly = 0;
at_which_save_slot = party.at_which_save_slot;
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
if (town_number == party.creature_save[i].which_town) { if (town_number == party.creature_save[i].which_town) {
c_town.monst = party.creature_save[i]; c_town.monst = party.creature_save[i];
@@ -1022,7 +1020,7 @@ void erase_specials()
void erase_out_specials() void erase_out_specials()
{ {
short i,j,k,l,m,out_num; short i,j,k,l,m;
special_node_type sn; special_node_type sn;
short sd1,sd2; short sd1,sd2;
@@ -1062,7 +1060,6 @@ void erase_out_specials()
for (k = 0; k < 18; k++) for (k = 0; k < 18; k++)
//GK if (outdoors[i][j].special_id[k] >= 0) //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]]; sn = outdoors[i][j].specials[outdoors[i][j].special_id[k]];
sd1 = sn.sd1; sd2 = sn.sd2; sd1 = sn.sd1; sd2 = sn.sd2;

View File

@@ -17,7 +17,7 @@
void pc_record_type::kill(short type) void pc_record_type::kill(short type)
{ {
short i = 24; short i = 24;
bool dummy, no_save = false, no_luck = false; bool no_save = false, no_luck = false;
location item_loc; location item_loc;
if (type >= 20) if (type >= 20)
@@ -62,7 +62,6 @@ void pc_record_type::kill(short type)
if (overall_mode != MODE_OUTDOORS) if (overall_mode != MODE_OUTDOORS)
for (i = 0; i < 24; i++) for (i = 0; i < 24; i++)
if (items[i].variety != ITEM_TYPE_NO_ITEM) { if (items[i].variety != ITEM_TYPE_NO_ITEM) {
dummy = place_item(items[i],item_loc,true);
items[i].variety = ITEM_TYPE_NO_ITEM; items[i].variety = ITEM_TYPE_NO_ITEM;
} }
if ((type == 2) || (type == 3)) if ((type == 2) || (type == 3))