summaryrefslogtreecommitdiff
path: root/src/sim
diff options
context:
space:
mode:
Diffstat (limited to 'src/sim')
-rw-r--r--src/sim/entity/entities/entity_grenade.rs7
-rw-r--r--src/sim/entity/mod.rs12
-rw-r--r--src/sim/lib/force.rs10
3 files changed, 17 insertions, 12 deletions
diff --git a/src/sim/entity/entities/entity_grenade.rs b/src/sim/entity/entities/entity_grenade.rs
index eead416..abc57d9 100644
--- a/src/sim/entity/entities/entity_grenade.rs
+++ b/src/sim/entity/entities/entity_grenade.rs
@@ -11,13 +11,6 @@ struct GrenadeEntityBehaviour {
}
impl EntityBehaviour for GrenadeEntityBehaviour {
- fn physics_update(
- &mut self,
- _update_ctx: &mut EntityUpdateCtx,
- _ctx: &mut SimCtx,
- _delta_time: f32,
- ) -> () {
- }
fn update(
&mut self,
update_ctx: &mut EntityUpdateCtx,
diff --git a/src/sim/entity/mod.rs b/src/sim/entity/mod.rs
index c6c350e..555d2c6 100644
--- a/src/sim/entity/mod.rs
+++ b/src/sim/entity/mod.rs
@@ -46,14 +46,20 @@ impl Marchable for EntityCells {
}
pub trait EntityBehaviour {
- fn update(&mut self, update_ctx: &mut EntityUpdateCtx, ctx: &mut SimCtx, delta_time: f32)
- -> ();
+ fn update(
+ &mut self,
+ update_ctx: &mut EntityUpdateCtx,
+ ctx: &mut SimCtx,
+ delta_time: f32,
+ ) -> () {
+ }
fn physics_update(
&mut self,
update_ctx: &mut EntityUpdateCtx,
ctx: &mut SimCtx,
delta_time: f32,
- ) -> ();
+ ) -> () {
+ }
}
pub struct EntityDef {
diff --git a/src/sim/lib/force.rs b/src/sim/lib/force.rs
index 8acfa15..ff65fef 100644
--- a/src/sim/lib/force.rs
+++ b/src/sim/lib/force.rs
@@ -4,7 +4,7 @@ use rand::random_range;
use crate::sim::{
cell::{
cell::Cell,
- materials::{MaterialId, fire::FireCellView},
+ materials::{MaterialForm, MaterialId, fire::FireCellView},
},
particle_manager::particle::Particle,
sim_manager::SimCtx,
@@ -52,7 +52,13 @@ pub fn apply_explosion(
1.0,
));
}
- } else {
+ } else if [
+ MaterialForm::Solid,
+ MaterialForm::Liquid,
+ MaterialForm::Powder,
+ ]
+ .contains(&cell.material.def().form)
+ {
ctx.cell_manager
.set_cell_from_game_position(ipos.x, ipos.y, fire, false);
if random_range(0.0..1.0) > 0.6 {