Skip to content

Commit

Permalink
Merge pull request #67 from SamurAI-Coding/official/fix_collide_died_…
Browse files Browse the repository at this point in the history
…player

[official] to ignore died player at collision process
  • Loading branch information
arukuka authored Jan 13, 2018
2 parents ba36c68 + cc07004 commit 2c69ebe
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions official/raceState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,11 @@ bool RaceState::playOneStep(int c) {
if (!goaled[0] && !goaled[1]) {
// Check collision if both sides have not reached the goal yet
// Going through the opponent's position is not allowed even with precedence
for (int i = 0; i < 2; ++i) {
if (res[i] == FUNNY) {
continue;
}
if (move[i].goesThru(players[1 - i].position)) {
res[i] = STOPPED;
if (res[0] != FUNNY && res[1] != FUNNY) {
for (int i = 0; i < 2; ++i) {
if (move[i].goesThru(players[1 - i].position)) {
res[i] = STOPPED;
}
}
}
// Check intersection
Expand Down

0 comments on commit 2c69ebe

Please sign in to comment.