summaryrefslogtreecommitdiff
path: root/src/sim/cell/materials/fire.rs
diff options
context:
space:
mode:
authorKai Stevenson <kai@kaistevenson.com>2026-08-21 00:14:10 -0700
committerKai Stevenson <kai@kaistevenson.com>2026-08-21 00:14:10 -0700
commita216e61a00bde792a49a92593012f9baecf86f3d (patch)
treee8df7028c29c569a3a54c688d8d12445e0086260 /src/sim/cell/materials/fire.rs
parent533da47f2cc03a8b60a7c6c0bb5a938a7e523a03 (diff)
explosions
Diffstat (limited to 'src/sim/cell/materials/fire.rs')
-rw-r--r--src/sim/cell/materials/fire.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/sim/cell/materials/fire.rs b/src/sim/cell/materials/fire.rs
index dd1ff8c..f582a0c 100644
--- a/src/sim/cell/materials/fire.rs
+++ b/src/sim/cell/materials/fire.rs
@@ -5,7 +5,7 @@ use crate::sim::{
cell_sim::sim::UpdateCtx,
};
-trait FireCellView {
+pub trait FireCellView {
fn get_ticks_lived(self) -> u16;
fn set_ticks_lived(&mut self, ticks: u16) -> ();
fn is_flammable(self) -> bool;
@@ -31,12 +31,13 @@ pub fn sim_update(ctx: &mut UpdateCtx) {
let ticks_lived = ctx.cell.get_ticks_lived();
// 2 seconds
if ticks_lived > 240 {
- // we have a chance to live longer--roughly 50% chance of living an extra second
- if ctx.rng.random_range(0.0..1.0) > 0.995 {
+ // we have a chance to live longer--roughly ?% chance of living an extra second
+ if ctx.rng.random_range(0.0..1.0) > 0.9 {
// kill ourselves, with a chance to turn into ash
+ ctx.do_rewrite = false;
if ctx.rng.random_range(0.0..1.0) > 0.8 {
// TODO ash material
- ctx.set_cell(0, 0, Cell::from_material(MaterialId::Sand));
+ // ctx.set_cell(0, 0, Cell::from_material(MaterialId::Sand));
} else {
ctx.set_cell(0, 0, Cell::void());
}