Synced the combat from under the dome.

This commit is contained in:
Zed A. Shaw 2026-05-24 11:59:51 -04:00
parent 110612c33a
commit a22564bb58
8 changed files with 106 additions and 27 deletions

View file

@ -192,8 +192,7 @@ void System::death() {
world.query<Combat>([&](auto ent, auto &combat) {
// bring out yer dead
if(combat.hp <= 0 && !combat.dead) {
combat.dead = true;
if(combat.is_dead()) {
if(ent != player.entity) {
// we won't change out the player's components later
dead_things.push_back(ent);
@ -301,7 +300,7 @@ void System::collision() {
for(auto entity : nearby) {
if(world.has<Combat>(entity)) {
auto combat = world.get<Combat>(entity);
if(!combat.dead) {
if(!combat.is_dead()) {
combat_count++;
world.send<game::Event>(game::Event::COMBAT_START, entity, entity);
}