Improved the corner kick actions, the next action after a corner was only in the next minute

This commit is contained in:
gunnar_g 2010-01-29 07:33:11 +00:00
parent c425e0a697
commit 8e7917bd5f
2 changed files with 18 additions and 3 deletions

View File

@ -459,10 +459,12 @@ lg_commentary_set_player_tokens(const LiveGameUnit *unit, const Fixture *fix)
pl2 = player_of_id_team(fix->teams[!unit->possession],
unit->event.player2);
}
else if(unit->event.type == LIVE_GAME_EVENT_OWN_GOAL ||
unit->event.type == LIVE_GAME_EVENT_CORNER_KICK)
else if(unit->event.type == LIVE_GAME_EVENT_OWN_GOAL)
pl1 = player_of_id_team(fix->teams[!unit->possession],
unit->event.player);
else if(unit->event.type == LIVE_GAME_EVENT_CORNER_KICK)
pl1 = player_of_id_team(fix->teams[unit->event.team],
unit->event.player);
else if(unit->event.type == LIVE_GAME_EVENT_FOUL ||
unit->event.type == LIVE_GAME_EVENT_FOUL_RED ||
unit->event.type == LIVE_GAME_EVENT_FOUL_RED_INJURY ||

View File

@ -814,6 +814,7 @@ live_game_event_general(gboolean create_new)
last_unit.event.type == LIVE_GAME_EVENT_MISS ||
last_unit.event.type == LIVE_GAME_EVENT_SAVE ||
last_unit.event.type == LIVE_GAME_EVENT_POST ||
last_unit.event.type == LIVE_GAME_EVENT_CORNER_KICK ||
last_unit.event.type == LIVE_GAME_EVENT_CROSS_BAR)
{
new.possession = !last_unit.possession;
@ -1252,7 +1253,8 @@ live_game_event_corner_kick()
if(stat0 == STATUS_LIVE_GAME_PAUSE)
return;
new.event.player =
new.event.player2 = -1;
new.minute = live_game_get_minute();
new.time = last_unit.time;
new.event.commentary = NULL;
@ -1273,6 +1275,17 @@ live_game_event_corner_kick()
g_array_append_val(unis, new);
live_game_finish_unit();
// The corner is taken, define what happens next
new = last_unit;
new.minute = -1;
new.event.team = new.possession;
new.event.commentary = NULL;
new.event.type = LIVE_GAME_EVENT_GENERAL;
new.event.commentary_id = -1;
live_game_fill_new_unit(&new);
g_array_append_val(unis, new);
live_game_evaluate_unit(&new);
}
/** Find out whether the specified player already has a yellow card