Skip to content

Commit

Permalink
Send updated research after it is fully updated
Browse files Browse the repository at this point in the history
Upon getting a free tech, the server was sending the updated research
before it was done updating the struct. The client received
contradicting information (in longturn#2405, that the tech was both fully
researched and still the current tech goal).

Closes longturn#2405.
  • Loading branch information
lmoureaux committed Oct 20, 2024
1 parent a8b4a45 commit 4f3b7cb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/techtools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,6 @@ void found_new_tech(struct research *presearch, Tech_type_id tech_found,
research_update(presearch);
}

// Inform players about their new tech.
send_research_info(presearch, nullptr);

if (was_first) {
/* Inform all players about new global advances to give them a
* chance for obsolete buildings. */
Expand Down Expand Up @@ -577,6 +574,9 @@ void found_new_tech(struct research *presearch, Tech_type_id tech_found,
presearch->bulbs_researched = 0;
}

// Inform players about their new tech.
send_research_info(presearch, nullptr);

if (bonus_tech_hack) {
Tech_type_id additional_tech;
char research_name[MAX_LEN_NAME * 2];
Expand Down

0 comments on commit 4f3b7cb

Please sign in to comment.