Fix various compiler warnings
This commit is contained in:
@@ -375,7 +375,7 @@ void start_outdoor_combat(cOutdoors::cCreature encounter,location where,short nu
|
||||
|
||||
bool pc_combat_move(location destination) {
|
||||
std::string create_line;
|
||||
short s1,s2,monst_exist;
|
||||
short s1,monst_exist;
|
||||
bool keep_going = true,forced = false,check_f = false;
|
||||
location monst_loc,store_loc;
|
||||
eDirection dir;
|
||||
@@ -420,16 +420,16 @@ bool pc_combat_move(location destination) {
|
||||
return true;
|
||||
}
|
||||
else if(monst_hit != nullptr) {
|
||||
// s2 = 2 here appears to mean "go ahead and attack", while s2 = 1 means "cancel attack".
|
||||
if(!monst_hit->is_friendly()) s2 = 2;
|
||||
bool do_attack = false;
|
||||
if(!monst_hit->is_friendly()) do_attack = true;
|
||||
else {
|
||||
std::string result = cChoiceDlog("attack-friendly",{"cancel","attack"}).show();
|
||||
if(result == "cancel") s2 = 1;
|
||||
else if(result == "attack") s2 = 2;
|
||||
if(result == "cancel") do_attack = false;
|
||||
else if(result == "attack") do_attack = true;
|
||||
}
|
||||
if(s2 == 2 && monst_hit->is_friendly())
|
||||
make_town_hostile();
|
||||
if(s2 == 2) {
|
||||
if(do_attack) {
|
||||
if(monst_hit->is_friendly())
|
||||
make_town_hostile();
|
||||
univ.current_pc().last_attacked = monst_hit;
|
||||
pc_attack(univ.cur_pc,monst_hit);
|
||||
return true;
|
||||
|
@@ -400,7 +400,6 @@ short monst_pick_target(short which_m) {
|
||||
if((dist(cur_monst->cur_loc,univ.town.monst[targ_m - 100].cur_loc) ==
|
||||
dist(cur_monst->cur_loc,univ.party[targ_pc].combat_pos)) && (get_ran(1,0,6) < 3))
|
||||
return targ_m;
|
||||
else return targ_pc;
|
||||
if(dist(cur_monst->cur_loc,univ.town.monst[targ_m - 100].cur_loc) <
|
||||
dist(cur_monst->cur_loc,univ.party[targ_pc].combat_pos))
|
||||
return targ_m;
|
||||
|
@@ -2634,7 +2634,7 @@ void affect_spec(const runtime_state& ctx) {
|
||||
// TODO: I think this is for compatibility with old scenarios? If so, remove it and just convert data on load.
|
||||
// (Actually, I think the only compatibility thing is that it's <= instead of ==)
|
||||
if(spec.ex2a <= 0) {
|
||||
int i;
|
||||
int i = 0;
|
||||
if(spec.ex1a == 2)
|
||||
ctx.cur_target = &univ.party;
|
||||
else if(spec.ex1a == 1) {
|
||||
|
@@ -242,8 +242,8 @@ void put_item_screen(eItemWinMode screen_num) {
|
||||
|
||||
default: // on an items page
|
||||
pc = screen_num;
|
||||
sout.str("");;
|
||||
sout << univ.party[pc].name << " inventory:",
|
||||
sout.str("");
|
||||
sout << univ.party[pc].name << " inventory:";
|
||||
win_draw_string(item_stats_gworld,upper_frame_rect,sout.str(),eTextMode::WRAP,style);
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user