mirror of
https://github.com/tstellar/bygfoot.git
synced 2025-02-01 08:26:54 +01:00
Finance fix.
This commit is contained in:
parent
518870cfaf
commit
3f7dbf6d04
@ -42,8 +42,8 @@ finance_update_user_weekly(User *user)
|
||||
if(query_team_plays(tm, week - 1, 1))
|
||||
for(i=0;i<tm->players->len;i++)
|
||||
{
|
||||
user->money_out[1][MON_OUT_WAGE] -= player_of_idx_team(tm, i)->wage;
|
||||
user->money -= player_of_idx_team(tm, i)->wage;
|
||||
user->money_out[1][MON_OUT_WAGE] -= g_array_index(tm->players, Player, i).wage;
|
||||
user->money -= g_array_index(tm->players, Player, i).wage;
|
||||
|
||||
if(player_of_idx_team(tm, i)->health > 0)
|
||||
{
|
||||
|
11
src/game.c
11
src/game.c
@ -259,10 +259,13 @@ game_initialize(Fixture *fix)
|
||||
usr(user_idx[0]).money += ticket_income;
|
||||
usr(user_idx[0]).money_in[1][MON_IN_TICKET] += ticket_income;
|
||||
|
||||
fix->teams[0]->stadium.safety -=
|
||||
math_rnd(const_float("float_game_stadium_safety_deterioration_lower"),
|
||||
const_float("float_game_stadium_safety_deterioration_upper"));
|
||||
fix->teams[0]->stadium.safety = CLAMP(fix->teams[0]->stadium.safety, 0, 1);
|
||||
if(debug < 50)
|
||||
{
|
||||
fix->teams[0]->stadium.safety -=
|
||||
math_rnd(const_float("float_game_stadium_safety_deterioration_lower"),
|
||||
const_float("float_game_stadium_safety_deterioration_upper"));
|
||||
fix->teams[0]->stadium.safety = CLAMP(fix->teams[0]->stadium.safety, 0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
for(i=0;i<2;i++)
|
||||
|
@ -482,7 +482,7 @@ live_game_event_stadium(void)
|
||||
|
||||
live_game_finish_unit();
|
||||
|
||||
if(team_is_user(tm0) != -1)
|
||||
if(team_is_user(tm0) != -1 && debug < 50)
|
||||
game_stadium_event(&tm0->stadium, last_unit.event.type);
|
||||
|
||||
match->stadium_event = last_unit.event.type;
|
||||
@ -803,6 +803,13 @@ live_game_event_send_off(gint team, gint player, gboolean second_yellow)
|
||||
player_card_set(player_of_id_team(tm[team], player), match->fix->clid, PLAYER_VALUE_CARD_RED,
|
||||
game_player_get_ban_duration(), FALSE);
|
||||
|
||||
if(team_is_user(tm[team]) != -1)
|
||||
{
|
||||
tm[team]->structure = team_find_appropriate_structure(tm[team]);
|
||||
team_rearrange(tm[team]);
|
||||
live_game_event_team_change(team, LIVE_GAME_EVENT_STRUCTURE_CHANGE);
|
||||
}
|
||||
|
||||
if(match->subs_left[team] > 0)
|
||||
{
|
||||
if(show && team_is_user(tm[team]) != -1 &&
|
||||
@ -830,7 +837,7 @@ live_game_event_send_off(gint team, gint player, gboolean second_yellow)
|
||||
live_game_event_team_change(team, LIVE_GAME_EVENT_STRUCTURE_CHANGE);
|
||||
}
|
||||
}
|
||||
else
|
||||
else if(team_is_user(tm[team]) == -1)
|
||||
{
|
||||
tm[team]->structure = team_find_appropriate_structure(tm[team]);
|
||||
team_rearrange(tm[team]);
|
||||
|
@ -42,7 +42,7 @@ WeekFunc start_week_funcs[] =
|
||||
{start_week_update_users, start_week_update_user_teams,
|
||||
start_week_update_user_finances, transfer_update, NULL};
|
||||
|
||||
WeekFunc end_week_funcs[] = {stat_update_leagues};
|
||||
WeekFunc end_week_funcs[] = {stat_update_leagues, NULL};
|
||||
|
||||
/** Generate the teams etc. */
|
||||
void
|
||||
|
Loading…
x
Reference in New Issue
Block a user