1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-26 10:00:42 +00:00

fixed some bug wiht fire mode

This commit is contained in:
Zeno Rogue 2023-10-27 23:26:26 +02:00
parent dd37a1c6c7
commit f99a473720

View File

@ -197,15 +197,13 @@ EX void switch_fire_mode() {
EX void add_fire(cell *c) { EX void add_fire(cell *c) {
bool emp = target_at.empty(); bool emp = target_at.empty();
auto& t = target_at[c->cpdist]; auto& t = target_at[c->cpdist];
if(t == c) { if(t == c && !bow::bowpath.empty()) {
println(hlog, "done");
bow::last_bowpath.clear(); bow::last_bowpath.clear();
checked_move_issue = miVALID; checked_move_issue = miVALID;
pcmove pcm; pcmove pcm;
pcm.checkonly = false; pcm.checkonly = false;
changes.init(false); changes.init(false);
bool b = pcm.try_shooting(false); bool b = pcm.try_shooting(false);
println(hlog, "b = ", b);
if(!b) changes.rollback(); if(!b) changes.rollback();
fire_mode = false; fire_mode = false;
} }
@ -217,7 +215,10 @@ EX void add_fire(cell *c) {
target_at = {}; target_at = {};
add_fire(c); add_fire(c);
} }
else addMessage(XLAT("No way to hit this place.")); else {
addMessage(XLAT("No way to hit this place."));
bow::bowpath = {};
}
} }
bow::last_bowpath = bow::bowpath; bow::last_bowpath = bow::bowpath;
} }