1
1
mirror of https://github.com/tstellar/bygfoot.git synced 2025-01-31 07:54:50 +01:00

"Minor betting fix."

This commit is contained in:
gyboth 2005-11-28 16:27:16 +00:00
parent 7dcd7e4246
commit e0a12a1856
4 changed files with 25 additions and 4 deletions

View File

@ -33,6 +33,7 @@
#include "misc.h"
#include "option.h"
#include "player.h"
#include "support.h"
#include "treeview2.h"
#include "user.h"
@ -220,8 +221,8 @@ bet_is_user(const BetMatch *bet)
gboolean
bet_place(gint fix_id, gint outcome, gint wager)
{
gfloat max_wager = finance_wage_unit(current_user.tm) *
const_float("float_bet_wager_limit_factor");
gint max_wager = (gint)rint(finance_wage_unit(current_user.tm) *
const_float("float_bet_wager_limit_factor"));
BetUser new_bet;
gchar buf[SMALL];
@ -236,8 +237,11 @@ bet_place(gint fix_id, gint outcome, gint wager)
if(wager > max_wager)
{
misc_print_grouped_int((gint)rint(max_wager), buf);
misc_print_grouped_int(max_wager, buf);
game_gui_show_warning(_("The betting office doesn't allow you to wager more than %s."), buf);
gtk_spin_button_set_value(
GTK_SPIN_BUTTON(lookup_widget(window.digits, "spinbutton1")),
(gdouble)max_wager);
return FALSE;
}

View File

@ -445,6 +445,7 @@ live_game_event_injury(gint team, gint player, gboolean create_new)
if((debug > 100 && stat2 != -1) ||
debug > 130)
printf("\t\tlive_game_event_injury\n");
if(create_new)
{
new = last_unit;
@ -898,6 +899,7 @@ live_game_event_send_off(gint team, gint player, gboolean second_yellow)
}
player_of_id_team(tms[team], player)->cskill = 0;
if(second_yellow)
player_card_set(player_of_id_team(tms[team], player), match->fix->clid, PLAYER_VALUE_CARD_RED, 2, FALSE);
else

View File

@ -1113,7 +1113,10 @@ player_update_weekly(Player *pl)
pl->name, pl->contract);
if(pl->contract <= 0)
{
player_remove_contract(pl);
return;
}
player_update_skill(pl);
}

View File

@ -1364,7 +1364,19 @@ treeview_create_finances(const User* user)
gtk_list_store_append(ls, &iter);
/* Finances balance. */
gtk_list_store_set(ls, &iter, 0, _("Bi-weekly balance"), 1, "", 2, "", -1);
if(week > 2)
{
if(week % 2 == 1)
sprintf(buf, _("Bi-weekly balance\n(Week %d and %d)"),
week - 2, week - 1);
else
sprintf(buf, _("Bi-weekly balance\n(Week %d and %d)"),
week - 3, week - 2);
}
else
strcpy(buf, _("Bi-weekly balance"));
gtk_list_store_set(ls, &iter, 0, buf, 1, "", 2, "", -1);
for(i=0;i<MON_IN_TRANSFERS;i++)
if(in[i] != 0)