Skip to content

Commit

Permalink
prevent double spacer lines when final half-inning has UER
Browse files Browse the repository at this point in the history
overload team::unearned to allow suppression of spacer
  • Loading branch information
seansweda committed Apr 19, 2017
1 parent 90bfd78 commit ef90efa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions team.cc
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ team::decisions()
}

void
team::unearned( int inning )
team::unearned( int inning, int spacer )
{
int numout = 0;
int ur = 0;
Expand Down Expand Up @@ -945,7 +945,8 @@ team::unearned( int inning )

curr = curr->next;
}
fprintf( output, "\n" );
if ( spacer )
fprintf( output, "\n" );
free( inputstr );
}

Expand Down
2 changes: 1 addition & 1 deletion team.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public :
int lob;
void newstat(char*, int);
void decisions();
void unearned(int);
void unearned(int, int = 1);
void box_score(FILE*);
void printstat(FILE*, int);
~team();
Expand Down
2 changes: 1 addition & 1 deletion update.cc
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ frame::update()
#endif
putcmd();
if ( errflag && runs )
pit->unearned(inning);
pit->unearned(inning, 0);

snprintf( outputstr, MAX_INPUT, "%s %d %s %d\n",
ibl[0]->nout(),ibl[0]->score, ibl[1]->nout(),ibl[1]->score );
Expand Down

0 comments on commit ef90efa

Please sign in to comment.