Fixed some things but now the world and boss fight worlds are out of sync and need to be fixed. tools/arena is broken.

This commit is contained in:
Zed A. Shaw 2025-12-13 13:13:59 -05:00
parent 37b007d79c
commit bf8ce7e16b
6 changed files with 48 additions and 21 deletions

View file

@ -47,6 +47,7 @@ int main(int, char*[]) {
auto main = boss::System::create_bossfight();
auto world = GameDB::current_world();
dbc::check(main->$world == world, "GameDB::current_world doesn't match boss fight world.");
while(!main->in_state(boss::State::END)) {
main->mouse_pos = window.mapPixelToCoords(router.position);
@ -61,19 +62,9 @@ int main(int, char*[]) {
}
}
while(world->has_event<Events::GUI>()) {
auto [evt, entity, data] = world->recv<Events::GUI>();
switch(evt) {
case Events::GUI::ATTACK:
main->event(gui::Event::ATTACK, data);
break;
case Events::GUI::COMBAT_START:
main->event(gui::Event::START_COMBAT, data);
break;
default:
fmt::println("GUI EVENT: {} entity={}", int(evt), entity);
}
if(main->$world->has_event<Events::GUI>()) {
main->handle_world_events();
dbc::check(!main->$world->has_event<Events::GUI>(), "You didn't eat all the events.");
}
main->render(window);