Skip to content

Commit

Permalink
Use character ID for solo faction IDs to ensure uniqueness (CleverRav…
Browse files Browse the repository at this point in the history
  • Loading branch information
RenechCDDA authored Oct 9, 2024
1 parent db874a2 commit f5cd465
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/debug_menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3539,6 +3539,7 @@ static void spawn_npc()
temp->getID() ) );
std::string new_fac_id = "solo_";
new_fac_id += temp->name;
new_fac_id += std::to_string( temp->getID().get_value() );
// create a new "lone wolf" faction for this one NPC
faction *new_solo_fac = g->faction_manager_ptr->add_new_faction( temp->name,
faction_id( new_fac_id ), faction_no_faction );
Expand Down
1 change: 1 addition & 0 deletions src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12875,6 +12875,7 @@ void game::perhaps_add_random_npc( bool ignore_spawn_timers_and_rates )

std::string new_fac_id = "solo_";
new_fac_id += tmp->name;
new_fac_id += std::to_string( tmp->getID().get_value() );
// create a new "lone wolf" faction for this one NPC
faction *new_solo_fac = faction_manager_ptr->add_new_faction( tmp->name, faction_id( new_fac_id ),
faction_no_faction );
Expand Down
1 change: 1 addition & 0 deletions src/npctalk_funcs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,7 @@ void talk_function::leave( npc &p )
g->remove_npc_follower( p.getID() );
std::string new_fac_id = "solo_";
new_fac_id += p.name;
new_fac_id += std::to_string( p.getID().get_value() );
p.job.clear_all_priorities();
// create a new "lone wolf" faction for this one NPC
faction *new_solo_fac = g->faction_manager_ptr->add_new_faction( p.name,
Expand Down

0 comments on commit f5cd465

Please sign in to comment.