Fixed Fylgja bug with the edge of the map.

This commit is contained in:
Storm Dragon
2026-02-06 14:13:02 -05:00
parent 07804ba73d
commit 5834793376

View File

@@ -166,12 +166,25 @@ void run_fylgja_menu() {
bool activate_fylgja(int fylgjaIndex) {
if (fylgjaIndex == FYLGJA_UNICORN) {
if (!can_start_unicorn_fylgja_charge()) {
speak_with_history("You need open ground in front of you to charge.", true);
return false;
}
start_unicorn_fylgja_charge();
return true;
}
return false;
}
bool can_start_unicorn_fylgja_charge() {
if (x <= BASE_END) return false;
int step = (facing == 1) ? 1 : -1;
int targetX = x + step;
if (targetX < 0 || targetX >= MAP_SIZE) return false;
if (should_stop_charge_for_climb_up(x, targetX)) return false;
return true;
}
void start_unicorn_fylgja_charge() {
reset_fishing_session();
@@ -261,7 +274,7 @@ void update_fylgja_charge() {
return;
}
if (x <= BASE_END || x <= 0 || x >= MAP_SIZE - 1) {
if (x <= BASE_END) {
stop_fylgja_charge();
return;
}
@@ -297,7 +310,7 @@ void update_fylgja_charge() {
check_snare_collision(x);
apply_fylgja_trample_damage(x);
if (x <= BASE_END || x <= 0 || x >= MAP_SIZE - 1) {
if (x <= BASE_END) {
stop_fylgja_charge();
return;
}