Fixed three script host bugs; scriptkey

This commit is contained in:
2026-07-24 23:52:03 -05:00
parent 917f4b1bf0
commit 855b287a88
7 changed files with 127 additions and 77 deletions
+12 -2
View File
@@ -71,13 +71,16 @@ pub struct Board {
impl Board {
/// Return a list of all `ObjectId`s currently on the board.
pub fn all_ids(&self) -> Vec<ObjectId> {
self.grid.iter().filter_map(|cell| {
let mut grid_ids = self.grid.iter().filter_map(|cell| {
if let Some(Tile::Object(def)) = cell {
Some(def.scripting.id)
} else {
None
}
}).collect()
}).collect::<Vec<_>>();
grid_ids.extend(self.sensors.iter().map(|s| s.scripting.id));
grid_ids.sort();
grid_ids
}
/// Returns a reference to the `(Glyph, Archetype)` cell at `(x, y)`.
@@ -234,6 +237,13 @@ impl Board {
}
}
}
// Glowing sensors
for s in self.sensors.iter() {
if s.optics().glow > 0 {
add_source(&mut lighting, s.x, s.y, s.optics().glow, color_to_rgb(s.scripting.glyph.fg));
}
}
Some(lighting)
}