forkserf / forkserf

a continuation of "FreeSerf"

Home Page:https://forkserf.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

somehow a transporter became Holder to a Fisherman hut

tlongstretch opened this issue · comments

Debug: [serf.cc] inside Serf::handle_serf_idle_on_path_state, a serf of type Serf::TypeTransporter at pos 47330 is about to be set to StateWaitIdleOnPath because it was called to wake but there is another serf at this pos.  The other serf has type Serf::TypeTransporter, index 3666, pos 47330
Debug: [serf.cc] inside Serf::handle_serf_idle_on_path_state, a serf of type Serf::TypeTransporter at pos 45569 is about to be set to StateWaitIdleOnPath because it was called to wake but there is another serf at this pos.  The other serf has type Serf::TypeTransporter, index 3666, pos 45569
Debug: [serf] inside Serf::handle_serf_wake_at_flag_state(), serf #3666 of type Serf::TypeTransporter being set to Lost
Debug: [serf.cc] inside Building::requested_serf_reached, serf #3666 with serf type Serf::TypeTransporter being set to Holder of building #710 of building type Building::TypeFisher
Error: [game.cc] inside Game::update, CORRUPTION DETECTION, serf #3666 with serf->pos 44284 is marked as holder to building#710 at building pos 44284, BUT HE HAS NON-MATCHING STATE #0
Debug: [serf.cc] inside Serf::building_deleted, pos 44284, serf with index #3666
Debug: [serf.cc] inside Serf::building_deleted, pos 44284, serf with index #3666 and type Serf::TypeTransporter.  building at serf pos has index #710
Debug: [serf.cc] inside Serf::building_deleted, pos 44284, serf with index #3666 and type Serf::TypeTransporter.  setting serf->building_held to 0
Debug: [serf.cc] inside Serf::building_deleted, pos 44284, serf with index #3666 and type Serf::TypeTransporter.  current building_held if any is #710
Debug: [serf.cc] inside Serf::building_deleted, pos 44284, serf with index #3666 and type Serf::TypeTransporter.  current building_held if any is #0 THIS BETTER BE ZERO!!!
Debug: [serf.cc] inside Serf::building_deleted, pos 44284, serf with index #3666.  Occupant being set to StateEscapingbuilding
Debug: [serf] inside Serf::handle_serf_escape_building_state(), serf #3666 of type Serf::TypeTransporter being set to Lost

I wonder if he was sent to a Flag as a transporter, but since he was sent maybe hte road he was sent to was destroyed and also a new hut built at same flag and game thought he was the Fisherman serf?

At least, it seems like it would make sense to verify that any arriving Holder is actually the correct serf type. Also, check to see if there is blind assumption that any serf that reaches his destination flag and its a building must be he holder

saw it again soon after, I am thinking this is due to option_LostTransportersClearFaster, a lost transporter is likely trying to enter a newly built building that is waiting on its holder, and game thinks this serf is the holder


Debug: [serf] inside Serf::handle_serf_wake_at_flag_state(), serf #20146 of type Serf::TypeTransporter being set to Lost
Debug: [serf.cc] inside Building::requested_serf_reached, serf #20146 with serf type Serf::TypeTransporter being set to Holder of building #1130 of building type Building::TypeSawmill
Error: [game.cc] inside Game::update, CORRUPTION DETECTION, serf #20146 with serf->pos 43081 is marked as holder to building#1130 at building pos 43081, BUT HE HAS NON-MATCHING STATE #0
Debug: [serf.cc] inside Serf::building_deleted, pos 43081, serf with index #20146
Debug: [serf.cc] inside Serf::building_deleted, pos 43081, serf with index #20146 and type Serf::TypeTransporter.  building at serf pos has index #1130
Debug: [serf.cc] inside Serf::building_deleted, pos 43081, serf with index #20146 and type Serf::TypeTransporter.  setting serf->building_held to 0
Debug: [serf.cc] inside Serf::building_deleted, pos 43081, serf with index #20146 and type Serf::TypeTransporter.  current building_held if any is #1130
Debug: [serf.cc] inside Serf::building_deleted, pos 43081, serf with index #20146 and type Serf::TypeTransporter.  current building_held if any is #0 THIS BETTER BE ZERO!!!
Debug: [serf.cc] inside Serf::building_deleted, pos 43081, serf with index #20146.  Occupant being set to StateEscapingbuilding
Debug: [serf] inside Serf::handle_serf_escape_building_state(), serf #20146 of type Serf::TypeTransporter being set to Lost

adding a check building->has_serf() to flag_search_building_for_lost_generic_serf_search_cb

this fix seems to work, don't see this issue anymore