FSM now working better with animations spawning again. Still need to resolve enemies that run away jumping around, which is caused by run_systems() too much.

This commit is contained in:
Zed A. Shaw 2026-08-10 14:30:05 -04:00
parent 2b68696328
commit adcfbb883e
4 changed files with 59 additions and 23 deletions

View file

@ -190,7 +190,7 @@ void System::distribute_loot(Position target_pos) {
}
set_position(world, *level.collision, loot_entity, target_pos);
level.world->send<game::Event>(game::Event::ENTITY_SPAWN, loot_entity, {});
level.world->send<game::Event>(game::Event::ENTITY_SPAWN, loot_entity, {loot_entity});
}
void System::death() {
@ -209,8 +209,9 @@ void System::death() {
// we won't change out the player's components later
dead_things.push_back(ent);
}
// we need to send this event for everything that dies
world.send<game::Event>(game::Event::DEATH, ent, {});
world.send<game::Event>(game::Event::DEATH, ent, {ent});
} else if(combat.almost_dead()) {
// if enemies are below 50% health they are marked with bad health
if(world.has<ai::EntityAI>(ent)) {
@ -473,7 +474,7 @@ void System::drop_item(Entity item) {
set_position(world, *level.collision, item, drop_spot);
level.world->not_constant(item);
level.world->send<game::Event>(game::Event::ENTITY_SPAWN, item, {});
level.world->send<game::Event>(game::Event::ENTITY_SPAWN, item, {item});
}
// NOTE: I think pickup and this need to be different