Multiplayer step B: every player order is a command (dig, build, cast, hand, orders) and the simulation runs in fixed 50 ms steps, so single player and a match take the same path

This commit is contained in:
Richard Zink committed 2026-11-04 09:57:02 +01:00
1 parent d6bcce3a76
commit 1ec7492189
8 files changed
+635 -101

No files matched your search

+2 -2
View File
@@ -66,7 +66,7 @@ impl Game {
}
let i = idx(x, y);
let kind = self.map.t[i].kind;
if self.map.t[i].owner != Owner::Player || room_index(kind).is_none() && kind != Kind::Floor {
if self.map.t[i].owner != self.me || room_index(kind).is_none() && kind != Kind::Floor {
self.hint(31, "hint.order_guard");
self.sfx_ui(Sfx::Error);
return;
@@ -77,7 +77,7 @@ impl Game {
for dx in -3..=3 {
if let Some(t) = self.map.get(x + dx, y + dy) {
let j = idx(x + dx, y + dy);
if t.kind == kind && t.owner == Owner::Player && t.reserved == 0 && !self.ents.iter().any(|e| e.job == Job::Guard(j)) {
if t.kind == kind && t.owner == self.me && t.reserved == 0 && !self.ents.iter().any(|e| e.job == Job::Guard(j)) {
spots.push(j);
}
}