Compare commits

..
2 Commits
Author SHA1 Message Date
Richard ZinkandClaude Opus 5.5 95655a0886 Bump version to v202611-00069
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 13:12:42 +01:00
Richard ZinkandClaude Opus 5.5 5a2ac32071 Command markers only with the debug setting; removing a marker clears them at once
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 13:12:41 +01:00
5 changed files with 15 additions and 8 deletions

No files matched your search

+1 -1
View File
@@ -1 +1 @@
v202611-00068 v202611-00069
+8 -5
View File
@@ -288,7 +288,7 @@ mod tests {
} }
#[test] #[test]
fn fixed_order_flags_do_not_need_the_debug_marker_setting() { fn command_markers_only_show_with_the_debug_setting() {
let mut g = game(13); let mut g = game(13);
g.debug_markers = false; g.debug_markers = false;
let (cx, cy) = g.map.core; let (cx, cy) = g.map.core;
@@ -296,10 +296,13 @@ mod tests {
g.queue(Act::Guard { x: cx, y: cy }); g.queue(Act::Guard { x: cx, y: cy });
g.queue(Act::Attack { ent: None, x: (cx + 20) as f32, y: (cy + 20) as f32 }); g.queue(Act::Attack { ent: None, x: (cx + 20) as f32, y: (cy + 20) as f32 });
g.queue(Act::Flag { x: cx, y: cy }); g.queue(Act::Flag { x: cx, y: cy });
assert!(!g.marks.iter().any(|m| m.kind == MARK_DIG), "dig stays hidden without debug markers"); assert!(g.marks.is_empty(), "the real shields, swords and flags show the orders");
assert!(g.marks.iter().any(|m| m.kind == MARK_GUARD && m.fixed), "guard is fixed"); // with the setting on they show, and removing a marker takes them away
assert!(g.marks.iter().any(|m| m.kind == MARK_ATTACK && m.fixed), "attack is fixed"); g.debug_markers = true;
assert!(g.marks.iter().any(|m| m.kind == MARK_FLAG && m.fixed), "gather flag is fixed"); g.queue(Act::Guard { x: cx + 2, y: cy + 2 });
assert!(g.marks.iter().any(|m| m.kind == MARK_GUARD));
g.unmark(cx as f32 + 2.5, cy as f32 + 2.5);
assert!(!g.marks.iter().any(|m| m.kind == MARK_GUARD), "gone with the marker");
} }
#[test] #[test]
+3 -1
View File
@@ -4316,7 +4316,9 @@ impl Game {
} }
pub fn add_mark(&mut self, x: f32, y: f32, kind: u8, side: u8, duration: f32, fixed: bool) { pub fn add_mark(&mut self, x: f32, y: f32, kind: u8, side: u8, duration: f32, fixed: bool) {
if (!fixed && !self.debug_markers) || duration <= 0.0 || !x.is_finite() || !y.is_finite() { // the shields, swords and the flag show themselves; these markers are for debugging only
let _ = fixed;
if !self.debug_markers || duration <= 0.0 || !x.is_finite() || !y.is_finite() {
return; return;
} }
let until = self.sim_steps + (duration / STEP).ceil() as u64; let until = self.sim_steps + (duration / STEP).ceil() as u64;
+2
View File
@@ -109,6 +109,8 @@ impl Game {
// a right click with an order tool: the marker there goes (its creatures are free again); // a right click with an order tool: the marker there goes (its creatures are free again);
// without a marker there the guards stand down // without a marker there the guards stand down
pub fn unmark(&mut self, wx: f32, wy: f32) { pub fn unmark(&mut self, wx: f32, wy: f32) {
// the command markers there go with it
self.marks.retain(|m| (m.x - wx).powi(2) + (m.y - wy).powi(2) >= 2.0 * 2.0);
let near = |m: &usize| { let near = |m: &usize| {
let (mx, my) = xy(*m); let (mx, my) = xy(*m);
(mx as f32 + 0.5 - wx).powi(2) + (my as f32 + 0.5 - wy).powi(2) < 1.6 * 1.6 (mx as f32 + 0.5 - wx).powi(2) + (my as f32 + 0.5 - wy).powi(2) < 1.6 * 1.6
+1 -1
View File
@@ -2908,7 +2908,7 @@ fn draw_marks(g: &Game, t: f32) {
return; return;
} }
for m in &g.marks { for m in &g.marks {
if !m.fixed && !g.debug_markers { if !g.debug_markers {
continue; continue;
} }
let left = m.until.saturating_sub(g.sim_steps) as f32 * STEP; let left = m.until.saturating_sub(g.sim_steps) as f32 * STEP;