comparison urogue/command.c @ 304:e52a8a7ad4c5

Fix many compiler warnings. There should only be two changes in behavior: arogue7/fight.c, arogue7/fight.c: a to-hit bonus is now correctly applied to characters who are not monks instead of monks who are not empty-handed. urogue/fight.c: fixed an interaction with the "debug" macro that could cause the wrong message to be displayed.
author John "Elwin" Edwards
date Wed, 14 Apr 2021 18:55:33 -0400
parents 4573b355cdc1
children c03d0b87211c
comparison
equal deleted inserted replaced
303:e06ebc407615 304:e52a8a7ad4c5
31 { 31 {
32 static char repcommand; /* Command to repeat if we are repeating */ 32 static char repcommand; /* Command to repeat if we are repeating */
33 static int fight_to_death; /* Flags if we are fighting to death */ 33 static int fight_to_death; /* Flags if we are fighting to death */
34 static coord dir; /* Last direction specified */ 34 static coord dir; /* Last direction specified */
35 35
36 #ifdef WIZARD
36 object *obj; 37 object *obj;
38 #endif
37 char ch; 39 char ch;
38 int ntimes = 1; /* Number of player moves */ 40 int ntimes = 1; /* Number of player moves */
39 coord nullcoord; 41 coord nullcoord;
40 42
41 nullcoord.x = nullcoord.y = 0; 43 nullcoord.x = nullcoord.y = 0;
577 579
578 /* 580 /*
579 * If he ran into something to take, let him pick it up. 581 * If he ran into something to take, let him pick it up.
580 */ 582 */
581 if (take != 0) 583 if (take != 0)
584 {
582 if (!moving) 585 if (!moving)
583 pick_up(take); 586 pick_up(take);
584 else 587 else
585 show_floor(); 588 show_floor();
589 }
586 if (!running) 590 if (!running)
587 door_stop = FALSE; 591 door_stop = FALSE;
588 } /* end while */ 592 } /* end while */
589 } 593 }
590 594
674 pstats.s_hpt /= 2; 678 pstats.s_hpt /= 2;
675 chg_str(-2, FALSE, FALSE); 679 chg_str(-2, FALSE, FALSE);
676 } 680 }
677 } 681 }
678 } 682 }
679 } 683 }
680 684
681 /* Time to enforce weapon and armor restrictions */ 685 /* Time to enforce weapon and armor restrictions */
682 if (rnd(9999) == 0) 686 if (rnd(9999) == 0)
687 {
683 if (((cur_weapon == NULL) || 688 if (((cur_weapon == NULL) ||
684 (wield_ok(&player, cur_weapon, NOMESSAGE))) 689 (wield_ok(&player, cur_weapon, NOMESSAGE)))
685 && ((cur_armor == NULL) || 690 && ((cur_armor == NULL) ||
686 (wear_ok(&player, cur_armor, NOMESSAGE)))) 691 (wear_ok(&player, cur_armor, NOMESSAGE))))
687 { 692 {
772 if ((pstats.s_hpt -= rnd(pstats.s_lvl)) <= 0) 777 if ((pstats.s_hpt -= rnd(pstats.s_lvl)) <= 0)
773 { 778 {
774 death(death_cause); 779 death(death_cause);
775 } 780 }
776 } 781 }
782 }
777 783
778 if (rnd(500000) == 0) 784 if (rnd(500000) == 0)
779 { 785 {
780 new_level(THRONE,0); 786 new_level(THRONE,0);
781 fighting = running = after = FALSE; 787 fighting = running = after = FALSE;
1036 wmove(cw, 0, 0); 1042 wmove(cw, 0, 0);
1037 1043
1038 while (strp->h_ch) 1044 while (strp->h_ch)
1039 { 1045 {
1040 if (strp->h_desc == 0) 1046 if (strp->h_desc == 0)
1047 {
1041 if (!wizard) 1048 if (!wizard)
1042 break; 1049 break;
1043 else 1050 else
1044 { 1051 {
1045 strp++; 1052 strp++;
1046 continue; 1053 continue;
1047 } 1054 }
1055 }
1048 1056
1049 if (strp->h_ch == helpch) 1057 if (strp->h_ch == helpch)
1050 { 1058 {
1051 msg("%s%s", unctrl(strp->h_ch), strp->h_desc); 1059 msg("%s%s", unctrl(strp->h_ch), strp->h_desc);
1052 break; 1060 break;
1069 cnt = 0; 1077 cnt = 0;
1070 1078
1071 while (strp->h_ch) 1079 while (strp->h_ch)
1072 { 1080 {
1073 if (strp->h_desc == 0) 1081 if (strp->h_desc == 0)
1082 {
1074 if (!wizard) 1083 if (!wizard)
1075 break; 1084 break;
1076 else 1085 else
1077 { 1086 {
1078 strp++; 1087 strp++;
1079 continue; 1088 continue;
1080 } 1089 }
1090 }
1081 1091
1082 mvwaddstr(hw, cnt % 23, cnt > 22 ? 40 : 0, unctrl(strp->h_ch)); 1092 mvwaddstr(hw, cnt % 23, cnt > 22 ? 40 : 0, unctrl(strp->h_ch));
1083 waddstr(hw, strp->h_desc); 1093 waddstr(hw, strp->h_desc);
1084 strp++; 1094 strp++;
1085 1095