Skip to content

Commit

Permalink
Fixed RESEARCH script command (#3557)
Browse files Browse the repository at this point in the history
It has been broken for well over a decade, since the function was first rewritten.
Fixes #3555

Fixed unrelated function:
Fixes #3558
  • Loading branch information
Loobinex authored Oct 13, 2024
1 parent 5932f3c commit 23b8aed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/player_compprocs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1215,7 +1215,6 @@ static long computer_look_for_opponent(struct Computer2 *comp, MapSubtlCoord stl
{
set_flag(potential_opponents, to_flag(slab_owner));
current_idx = comp->opponent_relations[slab_owner].next_idx;
slab_owner = slab_owner;
pos = &comp->opponent_relations[slab_owner].pos_A[current_idx];
comp->opponent_relations[slab_owner].next_idx = (current_idx + 1) % COMPUTER_SPARK_POSITIONS_COUNT;
comp->opponent_relations[slab_owner].field_0 = game.play_gameturn;
Expand Down
7 changes: 5 additions & 2 deletions src/room_library.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,16 +266,19 @@ TbBool add_research_to_all_players(long rtyp, long rkind, long amount)
TbBool update_players_research_amount(PlayerNumber plyr_idx, long rtyp, long rkind, long amount)
{
struct Dungeon* dungeon = get_dungeon(plyr_idx);
short n = 0;
for (long i = 0; i < dungeon->research_num; i++)
{
struct ResearchVal* resrch = &dungeon->research[i];
if ((resrch->rtyp == rtyp) && (resrch->rkind == rkind))
{
resrch->req_amount = amount;
}
n++;
}
if (n > 0)
return true;
}
return false;
return false;
}

TbBool update_or_add_players_research_amount(PlayerNumber plyr_idx, long rtyp, long rkind, long amount)
Expand Down

0 comments on commit 23b8aed

Please sign in to comment.