1
1
mirror of https://github.com/tstellar/bygfoot.git synced 2025-03-13 01:00:15 +01:00

1745 Commits

Author SHA1 Message Date
Tom Stellard
670b327a44 Fix some bad casts from GPtrArray to GArray
We missed fixing these in 47b6d5c80d182649d0d8b298600f3b36eb99bfaa.

(cherry picked from commit fe81b1c91f3528f0b4c63f14cc3aa6b209a7f3ab)
2022-01-25 16:38:27 -08:00
Tom Stellard
f18841c40b Fix crash when closing the live game window after loading a saved game
(cherry picked from commit b0922c2f0794f6b2f6c24c6e806c4d227d1679bd)
2022-01-25 16:38:15 -08:00
Tom Stellard
2100bc8dc5 Fix bug with player attributes being updated too often
Attributes like age, contract length, and health were being updated
multiple times per round for players on teams in cups.

(cherry picked from commit 05061dd36dc3ec13b3b96fbe81e7b151be60f4b2)
2022-01-25 16:38:05 -08:00
Tom Stellard
a7bb73dac1 Fix error with team_get_index()
We were casting a GPtrArray to a GArray, so the function wasn't
working at all.

(cherry picked from commit 6e32be503cfa2d15d8060d7f305fe1b6e8cd4797)
2022-01-15 10:12:39 -08:00
Tom Stellard
6abdf5872d Fix slow game saves
In some cases when the save directory has a lot of files it was taking
hours to save games due to gtk taking a long time to process new file
events.  This fixes the problem by destroying the file chooser window
before saving a game.

(cherry picked from commit 6d57140a4fd8e59885e139f9cd0e29a18b3ff60d)
2022-01-14 21:05:19 -08:00
Tom Stellard
e9b027d5ad Fix hang when saving a game
(cherry picked from commit 3d4faf523ad8b53f735dd9e2bdd0d2956ba01458)
2022-01-08 01:40:59 -08:00
Tom Stellard
b607776d44 Fix segfault when saving a game
(cherry picked from commit 6059a2136155ab918e5a087e0c605d2eda9d48cf)
2022-01-08 01:40:45 -08:00
Tom Stellard
6b29bbad77 Bump version to 2.3.4 2022-01-07 22:29:14 -08:00
Tom Stellard
84daa736a8 Ensure that all teams are loaded from a save file before looking up pointers
This fixes a crash when loading a save file from the command line.
2021-08-26 22:41:49 -07:00
Tom Stellard
da454689f6 Initial gitlab ci 2021-08-25 20:10:09 -07:00
Tom Stellard
f1eead603e cmake: Declare project as a C project
This way cmake won't try to look for a C++ compiler when configuring.
2021-08-25 09:14:19 -07:00
Tom Stellard
b554ca8dbc cmake: Enable cpack packaging 2021-08-25 09:14:19 -07:00
Tom Stellard
5dbe9ce12e cmake: Add BYGFOOT_VERSION option 2021-08-24 02:22:18 -07:00
Tom Stellard
25d9880da4 Generate a 'pre-history' for cups
We know generate cup results for each cup before starting the game.
This allows cups to select last year's winner without having to
special case cup selection for the first season.
2.3.3-alpha3
2021-07-27 14:41:40 -04:00
Tom Stellard
313b5bd07b Fix-ups for European cup definitions 2021-07-27 14:41:40 -04:00
Tom Stellard
3935e6f997 Fix sid for the Kosovo country definition 2021-07-27 14:41:40 -04:00
Tom Stellard
2d17321b94 Enusre that a teams aren't added to cups more than once. 2021-07-27 14:41:40 -04:00
Tom Stellard
b2b3d55f58 Support the optional and alternative tags for user's league in cup defs 2021-07-27 14:41:40 -04:00
Tom Stellard
e95c6aac96 Remove the team_names file from the Cup struct
This field was not being updated correctly in some case and we
can just you the teams field instead to get the names.
2021-07-27 14:41:40 -04:00
Tom Stellard
f1c9f498fe Don't add the user's country to the country list
The user's country is already being stored in the country
global variable.
2021-07-27 14:41:40 -04:00
Tom Stellard
363cf73b13 benchmark.sh: Pass -n to gzip
This removes metadata from the compressed file so that identical
input files will produce identical compressed files.
2021-07-27 14:41:40 -04:00
Tom Stellard
b937cb2e20 cup_uefa_cl: Select the real uefa cup winners from the previous season 2021-07-27 14:41:40 -04:00
Tom Stellard
f7713e8b96 Fix bug with choose_team alternatives
If the main team was in the user's country and the alternative was not,
the choose team would fail, because there are different paths for
the user's country and other countries.

This patch merges both paths into cup_load_choose_team() so that
function will work for any country.
2021-07-27 14:41:40 -04:00
Tom Stellard
dd71c31eda Refactor cup_load_choose_team_generate()
Updates its signature to match cup_load_choose_team().
2021-07-27 14:41:40 -04:00
Tom Stellard
200a0dc08f Fix start week for Sweden promotion games 2021-07-27 14:41:40 -04:00
Tom Stellard
a1119d0dd8 Randomize teams lists of non-user countries every season
This way the international cups will have new teams each year.
2021-07-27 14:41:40 -04:00
Tom Stellard
7f17e114d4 workflows: Require success from test-country-defs.sh 2021-07-27 14:41:40 -04:00
Tom Stellard
3e4ead3aae Reset all cups at the beginning of each season
This fixes a bug in league fixture scheduling where league matches would
be scheduled around cup matches from the previous season.  This caused
league matches to be scheduled in later week rounds which in some cases
caused these matches to not be played.
2021-07-27 14:41:40 -04:00
Tom Stellard
4ee618fadf test/test-load-save.sh: Run another test after simulating a full seasons
There are some values in the save files which only exist after a full
season has been simulated (e.g. cup history), so make sure test this.
2021-07-27 14:41:40 -04:00
Tom Stellard
ac4d0fc546 Use cup history for self-referential cups 2021-07-27 14:41:40 -04:00
Tom Stellard
30d96e9952 Save cup results at the end of each season 2021-07-27 14:41:40 -04:00
Tom Stellard
fbfc2e22d8 Remove team_id from User object 2021-07-27 14:41:40 -04:00
Tom Stellard
a23db0b434 Remove team_ids field from Fixture object
We can fetch the ids from the teams object instead.
2021-07-27 14:41:40 -04:00
Tom Stellard
47fa16ddcd fixture_write_round_robin: Use a NULL team to represent a bye
Also don't write byes to the fixture list.  Previously we were writing
byes and removing them later.
2021-07-27 14:41:40 -04:00
Tom Stellard
0f5213bc4e Don't refresh fixture team pointers at the start of season
This is no longer necessary now that team pointers are stable.
2021-07-27 14:41:40 -04:00
Tom Stellard
801cb99b74 Remove team_id member from TableElement
This is no longer needed now that Team pointers always point to the same
team.
2021-07-27 14:41:40 -04:00
Tom Stellard
47b6d5c80d Use a GPtrArray to store teams in leagues
This allows us to have stable Team pointers throughout the game,
so we don't need to recompute pointers from Team IDs every time
the league order changes.
2021-07-27 14:41:40 -04:00
Tom Stellard
a004f939bb Refactor xml_league_read() 2021-07-27 14:41:40 -04:00
Tom Stellard
1fcec6e057 Refactor user_set_up_team_new_game() 2021-07-27 14:41:40 -04:00
Tom Stellard
d4cf73b8d8 Refactor treeview_create_team_selection_list()
Add a Country parameter so that it does not rely on global variables and
simplify some of the code.
2021-07-27 14:41:40 -04:00
Tom Stellard
9a0388cafd Refactor stat_update_league_players() 2021-07-27 14:41:40 -04:00
Tom Stellard
7c1fe79763 Refactor start_new_season_league_changes() 2021-07-27 14:41:40 -04:00
Tom Stellard
19d361fb82 Refactor league_season_start() 2021-07-27 14:41:40 -04:00
Tom Stellard
9d144835ed Refactor team_get_average_talents() 2021-07-27 14:41:40 -04:00
Tom Stellard
5373da9c30 Refactor job_change_country() 2021-07-27 14:41:40 -04:00
Tom Stellard
d84b8683ed Refactor fixture_remove_rrs() 2021-07-27 14:41:40 -04:00
Tom Stellard
05ac1ccb7c Refactor fixture_write_league_fixtures() 2021-07-27 14:41:40 -04:00
Tom Stellard
8ea51d65a1 Refactor cup_load_choose_team_from_cup() 2021-07-27 14:41:40 -04:00
Tom Stellard
273ca50688 json: Add command for getting the country's leagues 2021-07-27 14:41:40 -04:00
Tom Stellard
8df2c6b98c Fix Sweden league3 definitions
league3a and league3b have different promotion cups so the loser should
not have the option of going to the other league.
2021-07-27 14:41:40 -04:00