Fix tile outlines drawn over units (miniquad only depth-tests with depth writes); Soul Core starts with a treasury ring
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5158075d7b
commit
3e3084c35d
3 files changed
+28
-5
No files matched your search
+19
@@ -386,6 +386,16 @@ impl Game {
|
||||
hint_t: [-1000.0; 16],
|
||||
};
|
||||
let (cx, cy) = g.map.core;
|
||||
// the soul core starts surrounded by a one tile wide ring of treasury
|
||||
for y in cy - 1..=cy + 3 {
|
||||
for x in cx - 1..=cx + 3 {
|
||||
let t = &mut g.map.t[idx(x, y)];
|
||||
if t.kind == Kind::Floor {
|
||||
t.kind = Kind::Treasury;
|
||||
t.owner = Owner::Player;
|
||||
}
|
||||
}
|
||||
}
|
||||
for k in 0..4 {
|
||||
g.spawn(EK::Worker, false, cx as f32 - 0.5, cy as f32 + k as f32 * 0.7 + 0.3, 1);
|
||||
}
|
||||
@@ -3115,4 +3125,13 @@ mod tests {
|
||||
g.plan_entries();
|
||||
assert_eq!(g.planned_entries.len(), 2);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn core_starts_with_treasury_ring() {
|
||||
let g = Game::new(21, 64, 64);
|
||||
let (cx, cy) = g.map.core;
|
||||
let ring = (cy - 1..=cy + 3).flat_map(|y| (cx - 1..=cx + 3).map(move |x| (x, y))).filter(|&(x, y)| g.map.t[idx(x, y)].kind == Kind::Treasury).count();
|
||||
assert_eq!(ring, 16);
|
||||
assert_eq!(g.counts[0], 16);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user