mirror of
https://github.com/tstellar/bygfoot.git
synced 2025-03-16 18:50:10 +01:00
"Segfixes."
This commit is contained in:
parent
51d00387e9
commit
64c34275b8
512
po/bygfoot.pot
512
po/bygfoot.pot
File diff suppressed because it is too large
Load Diff
@ -22,7 +22,7 @@ bygfoot_SOURCES = \
|
||||
gui.c gui.h misc.h support.h variables.h window.h \
|
||||
interface.c callbacks.h interface.h support.h \
|
||||
language.c callbacks.h free.h language.h misc.h option.h variables.h window.h \
|
||||
lg_commentary.c free.h lg_commentary.h live_game.h misc.h option.h player.h variables.h \
|
||||
lg_commentary.c free.h lg_commentary.h live_game.h main.h misc.h option.h player.h variables.h \
|
||||
league.c cup.h league.h main.h maths.h misc.h option.h player.h stat.h table.h team.h user.h variables.h \
|
||||
live_game.c callbacks.h fixture.h free.h game.h game_gui.h lg_commentary.h live_game.h league.h main.h maths.h misc_callback_func.h option.h player.h support.h team.h treeview.h user.h variables.h window.h \
|
||||
load_save.c callbacks.h file.h game_gui.h gui.h load_save.h option.h support.h user.h variables.h xml_loadsave_misc.h xml_loadsave_cup.h xml_loadsave_league.h xml_loadsave_season_stats.h xml_loadsave_transfers.h xml_loadsave_users.h xml.h \
|
||||
|
@ -81,6 +81,8 @@ enum ExitCodes
|
||||
EXIT_OPTION_NOT_FOUND, /**< An option couldn't be found. */
|
||||
EXIT_POINTER_NOT_FOUND, /**< We didn't find a pointer needed. */
|
||||
EXIT_INT_NOT_FOUND, /**< We didn't find an integer value (mostly indices). */
|
||||
EXIT_NO_SUPPORT_DIR, /**< No support directory found. */
|
||||
EXIT_CUP_ROUND_ERROR, /**< Too few cup rounds. */
|
||||
EXIT_END
|
||||
};
|
||||
|
||||
|
@ -193,6 +193,7 @@ callback_show_fixtures_week(gint type)
|
||||
{
|
||||
default:
|
||||
g_warning("callback_show_fixtures_week: unknown type %d \n", type);
|
||||
return;
|
||||
break;
|
||||
case SHOW_CURRENT:
|
||||
if(week == 1 && week_round == 1)
|
||||
@ -261,7 +262,10 @@ callback_show_tables(gint type)
|
||||
clid = league_cup_get_previous_clid(clid);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_warning("callback_show_tables: unknown type %d \n", type);
|
||||
return;
|
||||
}
|
||||
|
||||
stat1 = clid;
|
||||
|
||||
@ -565,6 +569,7 @@ callback_show_player_list(gint type)
|
||||
{
|
||||
default:
|
||||
g_warning("callback_show_player_list: unknown type %d \n", type);
|
||||
return;
|
||||
break;
|
||||
case SHOW_CURRENT:
|
||||
stat1 = current_user.tm->clid;
|
||||
@ -607,6 +612,7 @@ callback_show_league_stats(gint type)
|
||||
{
|
||||
default:
|
||||
g_warning("callback_show_league_stats: unknown type %d \n", type);
|
||||
return;
|
||||
break;
|
||||
case SHOW_CURRENT:
|
||||
stat1 = current_user.tm->clid;
|
||||
@ -634,6 +640,7 @@ callback_show_season_history(gint type)
|
||||
{
|
||||
default:
|
||||
g_warning("callback_show_season_history: unknown type %d \n", type);
|
||||
return;
|
||||
break;
|
||||
case SHOW_CURRENT:
|
||||
stat1 = -1;
|
||||
|
@ -724,7 +724,7 @@ cup_from_clid(gint clid)
|
||||
|
||||
g_warning("cup_from_clid: didn't find cup with id %d\n", clid);
|
||||
|
||||
main_exit_program(EXIT_POINTER_NOT_FOUND, "");
|
||||
main_exit_program(EXIT_POINTER_NOT_FOUND, NULL);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@ -741,7 +741,7 @@ cup_from_sid(const gchar *sid)
|
||||
|
||||
g_warning("cup_from_sid: didn't find cup with sid %s \n", sid);
|
||||
|
||||
main_exit_program(EXIT_POINTER_NOT_FOUND, "");
|
||||
main_exit_program(EXIT_POINTER_NOT_FOUND, NULL);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
@ -63,18 +63,12 @@ cup_get_teams_sorted(const Cup *cup);
|
||||
gint
|
||||
cup_compare_success_tables(const Team *tm1, const Team *tm2, const Cup *cup, gint round);
|
||||
|
||||
GPtrArray*
|
||||
cup_get_teams_from_names(GPtrArray *team_names);
|
||||
|
||||
gint
|
||||
cup_compare_success(gconstpointer a, gconstpointer b, gpointer data);
|
||||
|
||||
gint
|
||||
cup_get_round_reached(const Team *tm, const GArray *fixtures);
|
||||
|
||||
GPtrArray*
|
||||
cup_get_choose_teams_pointers(Cup *cup);
|
||||
|
||||
gboolean
|
||||
query_cup_begins(const Cup *cup);
|
||||
|
||||
|
@ -491,7 +491,8 @@ file_get_first_support_dir(void)
|
||||
elem = elem->next;
|
||||
}
|
||||
|
||||
g_warning("file_get_first_support_dir: no primary support dir found.");
|
||||
main_exit_program(EXIT_NO_SUPPORT_DIR,
|
||||
"file_get_first_support_dir: no primary support dir found.");
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
@ -23,9 +23,6 @@ file_save_opt_file(const gchar *filename, OptionList *optionlist);
|
||||
GPtrArray*
|
||||
file_dir_get_contents(const gchar *dir_name, const gchar *prefix, const gchar *suffix);
|
||||
|
||||
void
|
||||
file_get_player_names(gint number_of_names);
|
||||
|
||||
gboolean
|
||||
file_my_fopen(const gchar *filename, gchar *bits, FILE **fil, gboolean abort_program);
|
||||
|
||||
|
@ -73,8 +73,11 @@ fixture_update(Cup *cup)
|
||||
return;
|
||||
|
||||
if(round + 1 > cup->rounds->len - 1)
|
||||
{
|
||||
g_warning("fixture_update: round index %d too high for round array (%d) in cup %s\n",
|
||||
round + 1, cup->rounds->len - 1, cup->name->str);
|
||||
main_exit_program(EXIT_CUP_ROUND_ERROR, NULL);
|
||||
}
|
||||
|
||||
new_round = &g_array_index(cup->rounds, CupRound, round + 1);
|
||||
|
||||
@ -1048,27 +1051,6 @@ fixture_get_matches(const Team *tm1, const Team *tm2)
|
||||
return matches;
|
||||
}
|
||||
|
||||
/** Return the matches the teams play in their league. */
|
||||
GPtrArray*
|
||||
fixture_get_league_matches(const Team *tm1, const Team *tm2)
|
||||
{
|
||||
gint i, j;
|
||||
GPtrArray *matches = g_ptr_array_new();
|
||||
|
||||
for(i=0;i<ligs->len;i++)
|
||||
if(lig(i).id == tm1->clid)
|
||||
for(j=0;j<lig(i).fixtures->len;j++)
|
||||
{
|
||||
if((g_array_index(lig(i).fixtures, Fixture, j).teams[0] == tm1 &&
|
||||
g_array_index(lig(i).fixtures, Fixture, j).teams[1] == tm2) ||
|
||||
(g_array_index(lig(i).fixtures, Fixture, j).teams[0] == tm2 &&
|
||||
g_array_index(lig(i).fixtures, Fixture, j).teams[1] == tm1))
|
||||
g_ptr_array_add(matches, &g_array_index(lig(i).fixtures, Fixture, j));
|
||||
}
|
||||
|
||||
return matches;
|
||||
}
|
||||
|
||||
/** Return the fixture going with the id. */
|
||||
Fixture*
|
||||
fixture_from_id(gint id)
|
||||
@ -1087,43 +1069,11 @@ fixture_from_id(gint id)
|
||||
|
||||
g_warning("fixture_from_id: fixture with id %d found \n", id);
|
||||
|
||||
main_exit_program(EXIT_POINTER_NOT_FOUND, "");
|
||||
main_exit_program(EXIT_POINTER_NOT_FOUND, NULL);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/** Move teams from upper leagues to the beginning of the
|
||||
array so that they get the bye.
|
||||
@param teams The randomised array of teams.
|
||||
@param bye_len The number of teams that get a bye.
|
||||
@return A new array. */
|
||||
void
|
||||
fixture_sort_teams_bye(GPtrArray *teams, gint bye_len)
|
||||
{
|
||||
gint i, j, moved = 0;
|
||||
GPtrArray *new_array = g_ptr_array_new();
|
||||
|
||||
for(i=0;i<ligs->len;i++)
|
||||
for(j=teams->len - 1; j >= 0; j--)
|
||||
if(((Team*)g_ptr_array_index(teams, j))->clid == lig(i).id && moved < bye_len)
|
||||
{
|
||||
g_ptr_array_add(new_array, g_ptr_array_index(teams, j));
|
||||
g_ptr_array_remove_index(teams, j);
|
||||
moved++;
|
||||
}
|
||||
else if(moved == bye_len)
|
||||
{
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
for(i=0;i<new_array->len;i++)
|
||||
g_ptr_array_add(teams, g_ptr_array_index(new_array, i));
|
||||
|
||||
g_ptr_array_free(new_array, TRUE);
|
||||
}
|
||||
|
||||
|
||||
/** Return the last week round number of the specified week. */
|
||||
gint
|
||||
fixture_get_last_week_round(gint week_number)
|
||||
|
@ -107,18 +107,12 @@ fixture_compare_func(gconstpointer a, gconstpointer b, gpointer data);
|
||||
GPtrArray*
|
||||
fixture_get_matches(const Team *tm1, const Team *tm2);
|
||||
|
||||
GPtrArray*
|
||||
fixture_get_league_matches(const Team *tm1, const Team *tm2);
|
||||
|
||||
GPtrArray*
|
||||
fixture_get_coming(const Team *tm);
|
||||
|
||||
Fixture*
|
||||
fixture_from_id(gint id);
|
||||
|
||||
void
|
||||
fixture_sort_teams_bye(GPtrArray *teams, gint bye_len);
|
||||
|
||||
gint
|
||||
fixture_get_last_week_round(gint week_number);
|
||||
|
||||
|
@ -49,9 +49,6 @@ free_cups_array(GArray **cups, gboolean reset);
|
||||
void
|
||||
free_cup(Cup *cup);
|
||||
|
||||
void
|
||||
free_cup_tables(GArray *tables, gboolean reset);
|
||||
|
||||
void
|
||||
free_cup_choose_team(CupChooseTeam *cup_choose_team);
|
||||
|
||||
|
@ -130,7 +130,10 @@ game_get_player(const Team *tm, gint player_type,
|
||||
else if(player_type == GAME_PLAYER_TYPE_PENALTY)
|
||||
return game_get_penalty_taker(tm, last_penalty);
|
||||
else
|
||||
{
|
||||
g_warning("game_get_player: unknown player type %d\n", player_type);
|
||||
main_exit_program(EXIT_INT_NOT_FOUND, NULL);
|
||||
}
|
||||
|
||||
game_get_player_probs(tm->players, probs, weights, skills);
|
||||
|
||||
@ -160,7 +163,7 @@ game_get_player(const Team *tm, gint player_type,
|
||||
player_of_idx_team(tm, i)->health, player_of_idx_team(tm, i)->cskill);
|
||||
}
|
||||
|
||||
main_exit_program(EXIT_INT_NOT_FOUND, "");
|
||||
main_exit_program(EXIT_INT_NOT_FOUND, NULL);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
22
src/gui.c
22
src/gui.c
@ -30,28 +30,6 @@ gui_label_set_text_from_int(GtkLabel *label, gint number, gboolean append)
|
||||
gtk_label_set_text(label, buf2);
|
||||
}
|
||||
|
||||
/* Set into or append an integer into a label.
|
||||
@param label The label.
|
||||
@param number The number.
|
||||
@param append Whether or not to append.
|
||||
@param precision Float precision to use. */
|
||||
void
|
||||
gui_label_set_text_from_float(GtkLabel *label, gfloat number,
|
||||
gboolean append, gint precision)
|
||||
{
|
||||
const gchar *current_text = gtk_label_get_text(label);
|
||||
gchar buf[SMALL];
|
||||
|
||||
strcpy(buf, "");
|
||||
|
||||
if(!append)
|
||||
sprintf(buf, "%.*f", precision, number);
|
||||
else
|
||||
sprintf(buf, "%s%.*f", current_text, precision, number);
|
||||
|
||||
gtk_label_set_text(label, buf);
|
||||
}
|
||||
|
||||
/* Show a window with a progress bar.
|
||||
@param value The value of the progress bar. If set to 1
|
||||
or < 0 the progress bar window gets destroyed.
|
||||
|
@ -6,10 +6,6 @@
|
||||
void
|
||||
gui_label_set_text_from_int(GtkLabel *label, gint number, gboolean append);
|
||||
|
||||
void
|
||||
gui_label_set_text_from_float(GtkLabel *label, gfloat number,
|
||||
gboolean append, gint precision);
|
||||
|
||||
void
|
||||
gui_show_progress(gfloat value, gchar *text);
|
||||
|
||||
|
@ -9,9 +9,6 @@
|
||||
gint
|
||||
language_get_code_index(const gchar *code);
|
||||
|
||||
void
|
||||
language_get_code_name(const gchar *string, gboolean to_name, gchar *buf);
|
||||
|
||||
void
|
||||
language_set(gint index);
|
||||
|
||||
|
@ -99,7 +99,10 @@ league_cup_get_index_from_clid(gint clid)
|
||||
}
|
||||
|
||||
if(index == -1)
|
||||
{
|
||||
g_warning("league_cup_get_index_from_clid: couldn't find league or cup with id %d\n", clid);
|
||||
main_exit_program(EXIT_POINTER_NOT_FOUND, NULL);
|
||||
}
|
||||
|
||||
return index;
|
||||
}
|
||||
@ -118,7 +121,7 @@ league_from_clid(gint clid)
|
||||
|
||||
g_warning("league_from_clid: didn't find league with id %d\n", clid);
|
||||
|
||||
main_exit_program(EXIT_POINTER_NOT_FOUND, "");
|
||||
main_exit_program(EXIT_POINTER_NOT_FOUND, NULL);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@ -274,7 +277,7 @@ league_index_from_sid(const gchar *sid)
|
||||
|
||||
g_warning("league_index_from_sid: no index found for sid '%s'.\n", sid);
|
||||
|
||||
main_exit_program(EXIT_INT_NOT_FOUND, "");
|
||||
main_exit_program(EXIT_INT_NOT_FOUND, NULL);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
@ -19,9 +19,6 @@ league_new(gboolean new_id);
|
||||
PromRelElement
|
||||
prom_rel_element_new(void);
|
||||
|
||||
TableElement
|
||||
league_table_element_new(Team *team);
|
||||
|
||||
gint
|
||||
league_cup_get_index_from_clid(gint clid);
|
||||
|
||||
@ -40,9 +37,6 @@ league_cup_get_next_fixture(gint clid, gint week_number, gint week_round_number)
|
||||
Fixture*
|
||||
league_cup_get_previous_fixture(gint clid, gint week_number, gint week_round_number);
|
||||
|
||||
gint
|
||||
league_get_index(gint clid);
|
||||
|
||||
gint
|
||||
league_cup_average_capacity(gint clid);
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include "free.h"
|
||||
#include "lg_commentary.h"
|
||||
#include "live_game.h"
|
||||
#include "main.h"
|
||||
#include "misc.h"
|
||||
#include "option.h"
|
||||
#include "player.h"
|
||||
@ -440,8 +441,11 @@ lg_commentary_get_player_name(const LiveGameUnit *unit, const Fixture *fix, gboo
|
||||
player_get_last_name(player_of_id_team(fix->teams[unit->event.team],
|
||||
unit->event.player)->name->str);
|
||||
else
|
||||
{
|
||||
g_warning("lg_commentary_get_player_name: unknown event type %d\n",
|
||||
unit->event.type);
|
||||
main_exit_program(EXIT_INT_NOT_FOUND, NULL);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
@ -699,8 +699,11 @@ live_game_event_general(gboolean create_new)
|
||||
new.area = LIVE_GAME_UNIT_AREA_MIDFIELD;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_warning("live_game_event_general: unknown event type: %d\n",
|
||||
last_unit.event.type);
|
||||
main_exit_program(EXIT_INT_NOT_FOUND, NULL);
|
||||
}
|
||||
|
||||
g_array_append_val(unis, new);
|
||||
}
|
||||
@ -1164,7 +1167,8 @@ live_game_unit_get_minute(const LiveGameUnit *unit)
|
||||
break;
|
||||
|
||||
if(i == -1)
|
||||
g_warning("live_game_unit_get_minute: reached end of unis array.\n");
|
||||
main_exit_program(EXIT_INT_NOT_FOUND,
|
||||
"live_game_unit_get_minute: reached end of units array.");
|
||||
else
|
||||
for(j=i;j>=0;j--)
|
||||
if(uni(j).minute != -1)
|
||||
@ -1204,7 +1208,7 @@ live_game_unit_before(const LiveGameUnit* unit, gint gap)
|
||||
}
|
||||
}
|
||||
|
||||
main_exit_program(EXIT_POINTER_NOT_FOUND, "");
|
||||
main_exit_program(EXIT_POINTER_NOT_FOUND, NULL);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@ -1455,7 +1459,7 @@ live_game_reset(LiveGame *live_game, Fixture *fix, gboolean free_variable)
|
||||
gint
|
||||
live_game_event_get_verbosity(gint event_type)
|
||||
{
|
||||
gint return_value;
|
||||
gint return_value = -1;
|
||||
|
||||
if(event_type == LIVE_GAME_EVENT_START_MATCH ||
|
||||
event_type == LIVE_GAME_EVENT_HALF_TIME ||
|
||||
@ -1505,7 +1509,7 @@ live_game_event_get_verbosity(gint event_type)
|
||||
{
|
||||
g_warning("live_game_event_get_verbosity: unknown event type %d \n",
|
||||
event_type);
|
||||
return_value = -1;
|
||||
main_exit_program(EXIT_INT_NOT_FOUND, NULL);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
|
@ -64,9 +64,6 @@ live_game_event_free_kick(void);
|
||||
void
|
||||
live_game_event_send_off(gint team, gint player, gboolean second_yellow);
|
||||
|
||||
void
|
||||
live_game_generate_commentary(LiveGameUnit *unit);
|
||||
|
||||
void
|
||||
live_game_event_duel(void);
|
||||
|
||||
@ -79,9 +76,6 @@ live_game_reset(LiveGame *live_game, Fixture *fix, gboolean free_variable);
|
||||
gint
|
||||
live_game_unit_get_minute(const LiveGameUnit *unit);
|
||||
|
||||
void
|
||||
live_game_create_stats(void);
|
||||
|
||||
gint
|
||||
live_game_get_area(const LiveGameUnit *unit);
|
||||
|
||||
|
10
src/option.c
10
src/option.c
@ -17,7 +17,7 @@ option_string(const gchar *name, OptionList *optionlist)
|
||||
else
|
||||
return ((Option*)element)->string_value->str;
|
||||
|
||||
main_exit_program(EXIT_OPTION_NOT_FOUND, "");
|
||||
main_exit_program(EXIT_OPTION_NOT_FOUND, NULL);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@ -33,7 +33,7 @@ option_string_pointer(const gchar *name, OptionList *optionlist)
|
||||
else
|
||||
return ((Option*)element)->string_value;
|
||||
|
||||
main_exit_program(EXIT_OPTION_NOT_FOUND, "");
|
||||
main_exit_program(EXIT_OPTION_NOT_FOUND, NULL);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@ -53,7 +53,7 @@ option_int(const gchar *name, OptionList *optionlist)
|
||||
else
|
||||
return ((Option*)element)->value;
|
||||
|
||||
main_exit_program(EXIT_OPTION_NOT_FOUND, "");
|
||||
main_exit_program(EXIT_OPTION_NOT_FOUND, NULL);
|
||||
|
||||
return -1;
|
||||
}
|
||||
@ -69,7 +69,7 @@ option_int_pointer(const gchar *name, OptionList *optionlist)
|
||||
else
|
||||
return &((Option*)element)->value;
|
||||
|
||||
main_exit_program(EXIT_OPTION_NOT_FOUND, "");
|
||||
main_exit_program(EXIT_OPTION_NOT_FOUND, NULL);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@ -89,7 +89,7 @@ option_float(const gchar *name, OptionList *optionlist)
|
||||
else
|
||||
return (gfloat)((Option*)element)->value / 10000;
|
||||
|
||||
main_exit_program(EXIT_OPTION_NOT_FOUND, "");
|
||||
main_exit_program(EXIT_OPTION_NOT_FOUND, NULL);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
@ -212,7 +212,7 @@ player_id_index(const Team *tm, gint player_id)
|
||||
|
||||
g_warning("player_id_index: didn't find player with id %d of team %s\n", player_id, tm->name->str);
|
||||
|
||||
main_exit_program(EXIT_INT_NOT_FOUND, "");
|
||||
main_exit_program(EXIT_INT_NOT_FOUND, NULL);
|
||||
|
||||
return -1;
|
||||
}
|
||||
@ -229,7 +229,7 @@ player_of_idx_team(const Team *tm, gint number)
|
||||
g_warning("player_of_idx_team: Player list of team %s too short for number %d.\n",
|
||||
tm->name->str, number);
|
||||
|
||||
main_exit_program(EXIT_POINTER_NOT_FOUND, "");
|
||||
main_exit_program(EXIT_POINTER_NOT_FOUND, NULL);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@ -253,7 +253,7 @@ player_of_id_team(const Team *tm, gint id)
|
||||
|
||||
g_warning("player_of_id_team: didn't find player with id %d of team %s\n", id, tm->name->str);
|
||||
|
||||
main_exit_program(EXIT_POINTER_NOT_FOUND, "");
|
||||
main_exit_program(EXIT_POINTER_NOT_FOUND, NULL);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@ -777,7 +777,10 @@ player_games_goals_get(const Player *pl, gint clid, gint type)
|
||||
else if(type == PLAYER_VALUE_SHOTS)
|
||||
return_value = g_array_index(pl->games_goals, PlayerGamesGoals, i).shots;
|
||||
else
|
||||
{
|
||||
g_warning("player_games_goals_get: unknown type %d.\n", type);
|
||||
main_exit_program(EXIT_INT_NOT_FOUND, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
return return_value;
|
||||
|
@ -16,9 +16,6 @@ enum PlayerCompareAttrib
|
||||
Player
|
||||
player_new(Team *tm, gfloat average_skill, gboolean new_id);
|
||||
|
||||
gint
|
||||
player_new_id(const GArray *players);
|
||||
|
||||
gint
|
||||
player_get_position_from_structure(gint structure, gint player_number);
|
||||
|
||||
|
29
src/team.c
29
src/team.c
@ -86,22 +86,6 @@ team_assign_playing_structure(void)
|
||||
return 343;
|
||||
}
|
||||
|
||||
/** Return a stadium struct with default values. */
|
||||
Stadium
|
||||
team_stadium_new(void)
|
||||
{
|
||||
Stadium new;
|
||||
|
||||
new.capacity = -1;
|
||||
new.safety = 0;
|
||||
|
||||
new.average_attendance =
|
||||
new.possible_attendance =
|
||||
new.games = 0;
|
||||
|
||||
return new;
|
||||
}
|
||||
|
||||
/* Fill the players array of the team and the stadium.
|
||||
@param tm The team that gets filled. */
|
||||
void
|
||||
@ -223,7 +207,7 @@ team_of_id(gint id)
|
||||
|
||||
g_warning("team_of_id: team with id %d not found.", id);
|
||||
|
||||
main_exit_program(EXIT_POINTER_NOT_FOUND, "");
|
||||
main_exit_program(EXIT_POINTER_NOT_FOUND, NULL);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@ -397,7 +381,7 @@ team_get_league_rank(const Team *tm)
|
||||
g_warning("team_get_league_rank: no rank found for team %s in league %s. \n",
|
||||
tm->name->str, league_cup_get_name_string(tm->clid));
|
||||
|
||||
main_exit_program(EXIT_INT_NOT_FOUND, "");
|
||||
main_exit_program(EXIT_INT_NOT_FOUND, NULL);
|
||||
|
||||
return -1;
|
||||
}
|
||||
@ -417,7 +401,7 @@ team_get_cup_rank(const Team *tm, const CupRound *cupround)
|
||||
|
||||
g_warning("team_get_cup_rank: no rank found for team %s. \n ", tm->name->str);
|
||||
|
||||
main_exit_program(EXIT_INT_NOT_FOUND, "");
|
||||
main_exit_program(EXIT_INT_NOT_FOUND, NULL);
|
||||
|
||||
return -1;
|
||||
}
|
||||
@ -493,6 +477,7 @@ team_attribute_to_char(gint attribute, gint value)
|
||||
{
|
||||
default:
|
||||
g_warning("team_attribute_to_char: unknown attribute %d\n", attribute);
|
||||
main_exit_program(EXIT_INT_NOT_FOUND, NULL);
|
||||
break;
|
||||
case TEAM_ATTRIBUTE_STYLE:
|
||||
switch(value)
|
||||
@ -722,7 +707,7 @@ team_get_table_value(const Team *tm, gint type)
|
||||
{
|
||||
g_warning("team_get_table_value: team is not a league team: %s \n", tm->name->str);
|
||||
|
||||
main_exit_program(EXIT_INT_NOT_FOUND, "");
|
||||
main_exit_program(EXIT_INT_NOT_FOUND, NULL);
|
||||
|
||||
return -1;
|
||||
}
|
||||
@ -737,7 +722,7 @@ team_get_table_value(const Team *tm, gint type)
|
||||
{
|
||||
g_warning("team_get_table_value: table entry not found for team %s \n", tm->name->str);
|
||||
|
||||
main_exit_program(EXIT_INT_NOT_FOUND, "");
|
||||
main_exit_program(EXIT_INT_NOT_FOUND, NULL);
|
||||
|
||||
return -1;
|
||||
}
|
||||
@ -901,7 +886,7 @@ team_get_index(const Team *tm)
|
||||
|
||||
g_warning("team_get_index: team %s not found.\n", tm->name->str);
|
||||
|
||||
main_exit_program(EXIT_INT_NOT_FOUND, "");
|
||||
main_exit_program(EXIT_INT_NOT_FOUND, NULL);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
@ -36,9 +36,6 @@ team_assign_playing_structure(void);
|
||||
gint
|
||||
team_assign_playing_style(void);
|
||||
|
||||
Stadium
|
||||
team_stadium_new(void);
|
||||
|
||||
gboolean
|
||||
query_is_my_team(const Team *tm);
|
||||
|
||||
|
@ -89,7 +89,7 @@ treeview_create_team_selection_list(gboolean show_cup_teams, gboolean show_user_
|
||||
@param treeview The treeview that gets configured.
|
||||
*/
|
||||
void
|
||||
treeview_set_up_team_selection_treeview (GtkTreeView *treeview)
|
||||
treeview_set_up_team_selection_treeview(GtkTreeView *treeview)
|
||||
{
|
||||
GtkTreeViewColumn *col;
|
||||
GtkCellRenderer *renderer;
|
||||
@ -235,8 +235,8 @@ treeview_create_player_list(GPtrArray *players, gint *attributes, gint max,
|
||||
|
||||
/** Set up the tree view for a player list */
|
||||
void
|
||||
treeview_set_up_player_list (GtkTreeView *treeview, gint *attributes, gint max,
|
||||
gboolean show_separator, gboolean sortable)
|
||||
treeview_set_up_player_list(GtkTreeView *treeview, gint *attributes, gint max,
|
||||
gboolean show_separator, gboolean sortable)
|
||||
{
|
||||
gint i;
|
||||
GtkTreeViewColumn *col;
|
||||
|
@ -40,9 +40,6 @@ treeview_live_game_show_commentary(const LiveGameUnit *unit);
|
||||
void
|
||||
treeview_live_game_show_initial_commentary(const LiveGameUnit *unit);
|
||||
|
||||
void
|
||||
treeview_live_game_show_teams(void);
|
||||
|
||||
void
|
||||
treeview_live_game_set_up_commentary(void);
|
||||
|
||||
|
@ -62,7 +62,6 @@ treeview_helper_get_index(GtkTreeView *treeview, gint column)
|
||||
@param column The column we'd like to get the content of.
|
||||
@return The pointer in the given column of the selected row.
|
||||
*/
|
||||
/*d*/
|
||||
gpointer
|
||||
treeview_helper_get_pointer(GtkTreeView *treeview, gint column)
|
||||
{
|
||||
@ -580,10 +579,10 @@ treeview_helper_get_attributes_from_scout(gint scout)
|
||||
@see The GTK reference. */
|
||||
void
|
||||
treeview_helper_team_selection(GtkTreeViewColumn *col,
|
||||
GtkCellRenderer *renderer,
|
||||
GtkTreeModel *model,
|
||||
GtkTreeIter *iter,
|
||||
gpointer user_data)
|
||||
GtkCellRenderer *renderer,
|
||||
GtkTreeModel *model,
|
||||
GtkTreeIter *iter,
|
||||
gpointer user_data)
|
||||
{
|
||||
gchar buf[SMALL];
|
||||
gint column = treeview_helper_get_col_number_column(col);
|
||||
|
20
src/user.c
20
src/user.c
@ -223,7 +223,7 @@ user_from_team(const Team *tm)
|
||||
g_warning("User going with team %s not found.\n",
|
||||
tm->name->str);
|
||||
|
||||
main_exit_program(EXIT_POINTER_NOT_FOUND, "");
|
||||
main_exit_program(EXIT_POINTER_NOT_FOUND, NULL);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@ -466,24 +466,6 @@ user_event_show_next(void)
|
||||
event->value_string->str, ((Team*)event->value_pointer)->name->str);
|
||||
game_gui_show_warning(buf);
|
||||
break;
|
||||
/* case EVENT_TYPE_TRANSFER_OFFER: */
|
||||
/* temp_int = transfer_get_index(event->user->tm, event->value1); */
|
||||
/* misc_print_grouped_int(transoff(temp_int, 0).fee, buf2, FALSE); */
|
||||
/* misc_print_grouped_int(ABS(transoff(temp_int, 0).fee - */
|
||||
/* player_of_id_team(event->user->tm, trans(temp_int).id)->value), buf3, FALSE); */
|
||||
/* if(transoff(temp_int, 0).fee - */
|
||||
/* player_of_id_team(event->user->tm, trans(temp_int).id)->value > 0) */
|
||||
/* strcat(buf3, _(" more")); */
|
||||
/* else */
|
||||
/* strcat(buf3, _(" less")); */
|
||||
|
||||
/* sprintf(buf, _("%s would like to buy %s. They offer %s for him, which is %s than the player's value. Do you accept?"), transoff(temp_int, 0).tm->name->str, */
|
||||
/* player_of_id_team(event->user->tm, trans(temp_int).id)->name->str, */
|
||||
/* buf2, buf3); */
|
||||
/* stat1 = STATUS_TRANSFER_OFFER; */
|
||||
/* stat2 = temp_int; */
|
||||
/* window_show_yesno(buf); */
|
||||
/* break; */
|
||||
case EVENT_TYPE_PLAYER_CAREER_STOP:
|
||||
sprintf(buf, _("%s's injury was so severe that he can't play football on a professional level anymore. He leaves your team."), player_of_id_team(event->user->tm, event->value1)->name->str);
|
||||
if(event->user->tm->players->len < 12)
|
||||
|
@ -329,6 +329,7 @@ window_create(gint window_type)
|
||||
{
|
||||
default:
|
||||
g_warning("window_create: unknown window type %d\n", window_type);
|
||||
main_exit_program(EXIT_INT_NOT_FOUND, NULL);
|
||||
break;
|
||||
case WINDOW_MAIN:
|
||||
if(window.main == NULL)
|
||||
|
@ -172,7 +172,7 @@ xml_country_read(const gchar *country_name)
|
||||
if(!g_file_get_contents(file_name, &file_contents, &length, &error))
|
||||
{
|
||||
g_warning("xml_country_read: error reading file %s\n", file_name);
|
||||
misc_print_error(&error, FALSE);
|
||||
misc_print_error(&error, TRUE);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -3,9 +3,6 @@
|
||||
|
||||
#include "bygfoot.h"
|
||||
|
||||
GPtrArray*
|
||||
xml_country_get_team_names(const gchar *country_name);
|
||||
|
||||
void
|
||||
xml_country_read_start_element (GMarkupParseContext *context,
|
||||
const gchar *element_name,
|
||||
|
@ -88,8 +88,12 @@ xml_loadsave_league_stat_end_element (GMarkupParseContext *context,
|
||||
else if(in_state == TAG_STAT_PLAYER_GOALIES)
|
||||
stat_array = lstat->player_goalies;
|
||||
else
|
||||
{
|
||||
g_warning("xml_loadsave_league_stat_end_element: unknown in_state %d \n",
|
||||
in_state);
|
||||
return;
|
||||
}
|
||||
|
||||
g_array_append_val(stat_array, new_stat);
|
||||
}
|
||||
else if(tag == TAG_STAT_VALUE_STRING ||
|
||||
|
@ -105,7 +105,7 @@ xml_name_read(const gchar *sid, NameList *namelist)
|
||||
if(!g_file_get_contents(file_name, &file_contents, &length, &error))
|
||||
{
|
||||
g_warning("xml_name_read: error reading file %s\n", file_name);
|
||||
misc_print_error(&error, FALSE);
|
||||
misc_print_error(&error, TRUE);
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user