Fixed three script host bugs; scriptkey
This commit is contained in:
+12
-2
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user