From c36da1985c9a72f4172e223b928837796aa40d50 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sat, 28 Oct 2023 08:22:31 +0200 Subject: [PATCH] crossbow:: peace, dual, and non-shmup multiplayer are incompatible --- config.cpp | 5 ++++- multi.cpp | 1 + system.cpp | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/config.cpp b/config.cpp index 3c7739c6..08172a9f 100644 --- a/config.cpp +++ b/config.cpp @@ -1542,7 +1542,10 @@ EX void initConfig() { -> editable({{"blade", "Standard Rogue weapon. Bump into a monster to hit. Most monsters attack you the same way."}, {"crossbow", "Hits all monsters in a straight line, but slow to reload. Press 'f' or click the crossbow icon to target."}}, "weapon selection", 'w') - -> set_value_to = [] (bow::eWeapon wpn) { bool b = game_active; if(wpn != bow::weapon) stop_game(); bow::weapon = wpn; if(b) start_game(); }; + -> set_value_to = [] (bow::eWeapon wpn) { bool b = game_active; if(wpn != bow::weapon) stop_game(); bow::weapon = wpn; + peace::on = false; if(dual::state) dual::disable(); if(multi::players > 1 && !shmup::on) multi::players = 1; + if(b) start_game(); + }; param_enum(bow::style, "bow_style", "bow_style", bow::style) -> editable({{"bull line", "Can go in either direction on odd shapes. 3 turns to reload."}, {"geodesic", "Graph geodesic: any sequence of tiles is OK as long as there are no shortcuts. 4 turns to reload."}}, diff --git a/multi.cpp b/multi.cpp index bd58ffc5..33ccb743 100644 --- a/multi.cpp +++ b/multi.cpp @@ -522,6 +522,7 @@ EX void showConfigureMultiplayer() { dialog::do_if_confirmed([i] { stop_game(); players = i; + if(multi::players > 1 && !shmup::on) bow::weapon = bow::wBlade; start_game(); }); }); diff --git a/system.cpp b/system.cpp index 292b1890..f6c7234e 100644 --- a/system.cpp +++ b/system.cpp @@ -1481,12 +1481,14 @@ EX void switch_game_mode(char switchWhat) { tactic::on = yendor::on = princess::challenge = randomPatternsMode = inv::on = false; racing::on = false; + bow::weapon = bow::wBlade; break; case rg::dualmode: stop_tour(); tour::on = false; racing::on = false; yendor::on = tactic::on = princess::challenge = false; + bow::weapon = bow::wBlade; if(!dual::state) dual::enable(); else dual::disable(); break; @@ -1569,6 +1571,7 @@ EX void switch_game_mode(char switchWhat) { shmup::on = !shmup::on; princess::challenge = false; if(!shmup::on) racing::on = false; + if(!shmup::on && multi::players > 1) bow::weapon = bow::wBlade; break; case rg::randpattern: