diff --git a/src/game/boe.actions.cpp b/src/game/boe.actions.cpp index 3d79aa43..3230d03c 100644 --- a/src/game/boe.actions.cpp +++ b/src/game/boe.actions.cpp @@ -2635,8 +2635,11 @@ void handle_death() { fs::path file_to_load = nav_get_party(); if(!file_to_load.empty()) load_party(file_to_load, univ); if(univ.party.is_alive()) { - if(overall_mode == MODE_STARTUP) - post_load(), finish_load_party(); + if(overall_mode == MODE_STARTUP) { + post_load(); + finish_load_party(); + univ.file = file_to_load; + } return; } } diff --git a/src/game/boe.appleevents.mm b/src/game/boe.appleevents.mm index 50601a16..2b190028 100644 --- a/src/game/boe.appleevents.mm +++ b/src/game/boe.appleevents.mm @@ -16,7 +16,6 @@ #include "boe.global.hpp" #include "choicedlog.hpp" -extern void finish_load_party(); extern void end_startup(); extern void post_load(); diff --git a/src/game/boe.combat.cpp b/src/game/boe.combat.cpp index 0b61e5c7..32a26692 100644 --- a/src/game/boe.combat.cpp +++ b/src/game/boe.combat.cpp @@ -30,7 +30,7 @@ extern eGameMode overall_mode; extern short which_combat_type; extern eItemWinMode stat_window; extern location center; -extern short combat_active_pc; +short combat_active_pc; extern bool monsters_going,spell_forced; extern bool flushingInput; extern sf::RenderWindow mainPtr; @@ -397,8 +397,16 @@ bool pc_combat_move(location destination) { return false; } - if(monst_hit == nullptr) + if(monst_hit == nullptr) { + short actual_pc=univ.cur_pc; keep_going = check_special_terrain(destination,eSpecCtx::COMBAT_MOVE,univ.current_pc(),&check_f); + // check if current pc is still alive, has not change, ... + if (actual_pc!=univ.cur_pc || + (univ.current_pc().main_status != eMainStatus::ALIVE && univ.current_pc().main_status != eMainStatus::SPLIT_ALIVE)) { + if(combat_active_pc == actual_pc) combat_active_pc = 6; // checkme: do we need also to check if actual_pc==univ.cur_pc + return true; + } + } if(check_f) forced = true; diff --git a/src/game/boe.graphutil.cpp b/src/game/boe.graphutil.cpp index a4d40fa1..6c976397 100644 --- a/src/game/boe.graphutil.cpp +++ b/src/game/boe.graphutil.cpp @@ -319,51 +319,51 @@ void draw_fields(location where){ return; auto const fields=univ.town.fields[where.x][where.y]; if ((fields&~(unsigned long)SPECIAL_EXPLORED)==0) return; - if(univ.town.is_force_wall(fields)) + if(fields & WALL_FORCE) Draw_Some_Item(fields_gworld,calc_rect(0,1),terrain_screen_gworld,where_draw,1,0); - if(univ.town.is_fire_wall(fields)) + if(fields & WALL_FIRE) Draw_Some_Item(fields_gworld,calc_rect(1,1),terrain_screen_gworld,where_draw,1,0); - if(univ.town.is_antimagic(fields)) + if(fields & FIELD_ANTIMAGIC) Draw_Some_Item(fields_gworld,calc_rect(2,1),terrain_screen_gworld,where_draw,1,0); - if(univ.town.is_scloud(fields)) + if(fields & CLOUD_STINK) Draw_Some_Item(fields_gworld,calc_rect(3,1),terrain_screen_gworld,where_draw,1,0); - if(univ.town.is_ice_wall(fields)) + if(fields & WALL_ICE) Draw_Some_Item(fields_gworld,calc_rect(4,1),terrain_screen_gworld,where_draw,1,0); - if(univ.town.is_blade_wall(fields)) + if(fields & WALL_BLADES) Draw_Some_Item(fields_gworld,calc_rect(5,1),terrain_screen_gworld,where_draw,1,0); - if(univ.town.is_sleep_cloud(fields)) + if(fields & CLOUD_SLEEP) Draw_Some_Item(fields_gworld,calc_rect(6,1),terrain_screen_gworld,where_draw,1,0); - if(univ.town.is_block(fields)) + if(fields & OBJECT_BLOCK) Draw_Some_Item(fields_gworld,calc_rect(3,0),terrain_screen_gworld,where_draw,1,0); - if(!is_combat() && univ.town.is_spot(fields)) + if(!is_combat() && (fields & SPECIAL_SPOT)) Draw_Some_Item(fields_gworld,calc_rect(4,0),terrain_screen_gworld,where_draw,1,0); - if(univ.town.is_web(fields)) + if(fields & FIELD_WEB) Draw_Some_Item(fields_gworld,calc_rect(5,0),terrain_screen_gworld,where_draw,1,0); - if(univ.town.is_crate(fields)) + if(fields & OBJECT_CRATE) Draw_Some_Item(fields_gworld,calc_rect(6,0),terrain_screen_gworld,where_draw,1,0); - if(univ.town.is_barrel(fields)) + if(fields & OBJECT_BARREL) Draw_Some_Item(fields_gworld,calc_rect(7,0),terrain_screen_gworld,where_draw,1,0); - if(univ.town.is_fire_barr(fields) || univ.town.is_force_barr(fields)) + if(fields & (BARRIER_FIRE | BARRIER_FORCE)) Draw_Some_Item(*ResMgr::textures.get("teranim"),calc_rect(8+(anim_ticks%4),4),terrain_screen_gworld,where_draw,1,0); - if(univ.town.is_quickfire(fields)) + if(fields & FIELD_QUICKFIRE) Draw_Some_Item(fields_gworld,calc_rect(7,1),terrain_screen_gworld,where_draw,1,0); - if(univ.town.is_sm_blood(fields)) + if(fields & SFX_SMALL_BLOOD) Draw_Some_Item(fields_gworld,calc_rect(0,3),terrain_screen_gworld,where_draw,1,0); - if(univ.town.is_med_blood(fields)) + if(fields & SFX_MEDIUM_BLOOD) Draw_Some_Item(fields_gworld,calc_rect(1,3),terrain_screen_gworld,where_draw,1,0); - if(univ.town.is_lg_blood(fields)) + if(fields & SFX_LARGE_BLOOD) Draw_Some_Item(fields_gworld,calc_rect(2,3),terrain_screen_gworld,where_draw,1,0); - if(univ.town.is_sm_slime(fields)) + if(fields & SFX_SMALL_SLIME) Draw_Some_Item(fields_gworld,calc_rect(3,3),terrain_screen_gworld,where_draw,1,0); - if(univ.town.is_lg_slime(fields)) + if(fields & SFX_LARGE_SLIME) Draw_Some_Item(fields_gworld,calc_rect(4,3),terrain_screen_gworld,where_draw,1,0); - if(univ.town.is_ash(fields)) + if(fields & SFX_ASH) Draw_Some_Item(fields_gworld,calc_rect(5,3),terrain_screen_gworld,where_draw,1,0); - if(univ.town.is_bones(fields)) + if(fields & SFX_BONES) Draw_Some_Item(fields_gworld,calc_rect(6,3),terrain_screen_gworld,where_draw,1,0); - if(univ.town.is_rubble(fields)) + if(fields & SFX_RUBBLE) Draw_Some_Item(fields_gworld,calc_rect(7,3),terrain_screen_gworld,where_draw,1,0); - if(univ.town.is_force_cage(fields)) { + if(fields & BARRIER_CAGE) { Draw_Some_Item(fields_gworld,calc_rect(1,0),terrain_screen_gworld,where_draw,1,0); forcecage_locs.push_back(where_draw); } diff --git a/src/game/boe.main.cpp b/src/game/boe.main.cpp index c7134273..e921d45b 100644 --- a/src/game/boe.main.cpp +++ b/src/game/boe.main.cpp @@ -93,7 +93,6 @@ location spell_targets[8]; /* Combat globals */ short which_combat_type; location center; -short combat_active_pc; effect_pat_type current_pat; short missile_firer,current_monst_tactic; short store_current_pc = 0; diff --git a/src/universe/universe.hpp b/src/universe/universe.hpp index e67f6209..6bd2ddcf 100644 --- a/src/universe/universe.hpp +++ b/src/universe/universe.hpp @@ -39,10 +39,6 @@ class cCurTown { cTown* arena; cTown*const record() const; - template static bool test_field(unsigned long allFields) - { - return allFields & Field; - } template bool test_field(short x, short y) const { if(!record()->is_on_map(x,y)) return false; @@ -72,33 +68,7 @@ public: bool prep_talk(short which); // Prepare for loading specified speech, returning true if already loaded void prep_arena(); // Set up for a combat arena void place_preset_fields(); - - static bool is_explored(unsigned long allFields) { return test_field(allFields); } - static bool is_force_wall(unsigned long allFields) { return test_field(allFields); } - static bool is_fire_wall(unsigned long allFields) { return test_field(allFields); } - static bool is_antimagic(unsigned long allFields) { return test_field(allFields); } - static bool is_scloud(unsigned long allFields) { return test_field(allFields); } // stinking cloud - static bool is_ice_wall(unsigned long allFields) { return test_field(allFields); } - static bool is_blade_wall(unsigned long allFields) { return test_field(allFields); } - static bool is_sleep_cloud(unsigned long allFields) { return test_field(allFields); } - static bool is_block(unsigned long allFields) { return test_field(allFields); } // currently unused - static bool is_spot(unsigned long allFields) { return test_field(allFields); } - static bool is_web(unsigned long allFields) { return test_field(allFields); } - static bool is_crate(unsigned long allFields) { return test_field(allFields); } - static bool is_barrel(unsigned long allFields) { return test_field(allFields); } - static bool is_fire_barr(unsigned long allFields) { return test_field(allFields); } - static bool is_force_barr(unsigned long allFields) { return test_field(allFields); } - static bool is_quickfire(unsigned long allFields) { return test_field(allFields); } - static bool is_sm_blood(unsigned long allFields) { return test_field(allFields); } - static bool is_med_blood(unsigned long allFields) { return test_field(allFields); } - static bool is_lg_blood(unsigned long allFields) { return test_field(allFields); } - static bool is_sm_slime(unsigned long allFields) { return test_field(allFields); } - static bool is_lg_slime(unsigned long allFields) { return test_field(allFields); } - static bool is_ash(unsigned long allFields) { return test_field(allFields); } - static bool is_bones(unsigned long allFields) { return test_field(allFields); } - static bool is_rubble(unsigned long allFields) { return test_field(allFields); } - static bool is_force_cage(unsigned long allFields) { return test_field(allFields); } - static bool is_road(unsigned long allFields) { return test_field(allFields); } + bool is_explored(short x, short y) const { return test_field(x,y); } bool is_force_wall(short x, short y) const { return test_field(x,y); } bool is_fire_wall(short x, short y) const { return test_field(x,y); }