Swallow actions for simulated NPCs

This commit is contained in:
Joshua Barretto 2023-04-02 19:59:05 +01:00
parent dfb5e32803
commit 1e70ccfb8d

View File

@ -6,7 +6,7 @@ use crate::{
use common::{
comp::{self, Body},
grid::Grid,
rtsim::{Actor, Personality},
rtsim::{Actor, NpcAction, Personality},
terrain::TerrainChunkSize,
vol::RectVolSize,
};
@ -264,6 +264,13 @@ impl Rule for SimulateNpcs {
}
}
// Consume NPC actions
for action in std::mem::take(&mut npc.controller.actions) {
match action {
NpcAction::Greet(_) => {}, // Currently, just swallow greeting actions
}
}
// Make sure NPCs remain on the surface
npc.wpos.z = ctx
.world