mirror of
https://github.com/tstellar/bygfoot.git
synced 2024-12-17 10:50:12 +01:00
changed the ticket income of cup matches without a second leg
This commit is contained in:
parent
73fd2c7e6b
commit
75bd245ab8
52
src/game.c
52
src/game.c
@ -272,6 +272,7 @@ void
|
|||||||
game_initialize(Fixture *fix)
|
game_initialize(Fixture *fix)
|
||||||
{
|
{
|
||||||
gint i, j;
|
gint i, j;
|
||||||
|
gboolean income_cup = FALSE;
|
||||||
gfloat journey_factor =
|
gfloat journey_factor =
|
||||||
(fix->clid < ID_CUP_START ||
|
(fix->clid < ID_CUP_START ||
|
||||||
(fix->clid >= ID_CUP_START &&
|
(fix->clid >= ID_CUP_START &&
|
||||||
@ -286,28 +287,45 @@ game_initialize(Fixture *fix)
|
|||||||
else
|
else
|
||||||
game_assign_attendance_neutral(fix);
|
game_assign_attendance_neutral(fix);
|
||||||
|
|
||||||
ticket_income =
|
if (fix->clid >= ID_CUP_START)
|
||||||
fix->attendance * const_int("int_team_stadium_ticket_price");
|
{
|
||||||
|
if (! g_array_index(cup_from_clid(fix->clid)->rounds, CupRound, fix->round).home_away)
|
||||||
|
{
|
||||||
|
ticket_income = fix->attendance * const_int("int_team_stadium_ticket_price") / 2;
|
||||||
|
income_cup = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
ticket_income = fix->attendance * const_int("int_team_stadium_ticket_price");
|
||||||
|
|
||||||
if(!sett_int("int_opt_disable_finances") && user_idx[0] != -1 && fix->home_advantage)
|
if(!sett_int("int_opt_disable_finances") && user_idx[0] != -1 && fix->home_advantage)
|
||||||
{
|
{
|
||||||
usr(user_idx[0]).money += ticket_income;
|
usr(user_idx[0]).money += ticket_income;
|
||||||
usr(user_idx[0]).money_in[1][MON_IN_TICKET] += ticket_income;
|
usr(user_idx[0]).money_in[1][MON_IN_TICKET] += ticket_income;
|
||||||
|
|
||||||
usr(user_idx[0]).money -=
|
usr(user_idx[0]).money -=
|
||||||
(gint)rint((gfloat)ticket_income *
|
(gint)rint((gfloat)ticket_income * (gfloat)usr(user_idx[0]).youth_academy.percentage / 100);
|
||||||
(gfloat)usr(user_idx[0]).youth_academy.percentage / 100);
|
usr(user_idx[0]).money_out[1][MON_OUT_YA] -=
|
||||||
usr(user_idx[0]).money_out[1][MON_OUT_YA] -=
|
(gint)rint((gfloat)ticket_income * (gfloat)usr(user_idx[0]).youth_academy.percentage / 100);
|
||||||
(gint)rint((gfloat)ticket_income *
|
|
||||||
(gfloat)usr(user_idx[0]).youth_academy.percentage / 100);
|
|
||||||
|
|
||||||
if(debug < 50)
|
if(debug < 50)
|
||||||
{
|
{
|
||||||
fix->teams[0]->stadium.safety -=
|
fix->teams[0]->stadium.safety -=
|
||||||
math_rnd(const_float("float_game_stadium_safety_deterioration_lower"),
|
math_rnd(const_float("float_game_stadium_safety_deterioration_lower"),
|
||||||
const_float("float_game_stadium_safety_deterioration_upper"));
|
const_float("float_game_stadium_safety_deterioration_upper"));
|
||||||
fix->teams[0]->stadium.safety = CLAMP(fix->teams[0]->stadium.safety, 0, 1);
|
fix->teams[0]->stadium.safety = CLAMP(fix->teams[0]->stadium.safety, 0, 1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!sett_int("int_opt_disable_finances") && user_idx[1] != -1 && income_cup)
|
||||||
|
{
|
||||||
|
usr(user_idx[1]).money += ticket_income;
|
||||||
|
usr(user_idx[1]).money_in[1][MON_IN_TICKET] += ticket_income;
|
||||||
|
|
||||||
|
usr(user_idx[1]).money -=
|
||||||
|
(gint)rint((gfloat)ticket_income * (gfloat)usr(user_idx[1]).youth_academy.percentage / 100);
|
||||||
|
usr(user_idx[1]).money_out[1][MON_OUT_YA] -=
|
||||||
|
(gint)rint((gfloat)ticket_income * (gfloat)usr(user_idx[1]).youth_academy.percentage / 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(i=0;i<2;i++)
|
for(i=0;i<2;i++)
|
||||||
|
Loading…
Reference in New Issue
Block a user