mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-14 08:01:38 +01:00
don't allow resignations below a certain point -- which happens to fix
divide-by-zero error.
This commit is contained in:
parent
daecc807c1
commit
2127394260
1 changed files with 8 additions and 7 deletions
|
@ -152,17 +152,18 @@ kill_from_log() {
|
|||
}
|
||||
|
||||
maybe_resign() {
|
||||
KEY=$1
|
||||
LOG=${LOGS[$KEY]}
|
||||
if grep -q XWRELAY_ALLHERE $LOG; then
|
||||
if [ 0 -eq $(($RANDOM % $RESIGN_RATIO)) ]; then
|
||||
echo "making $LOG $(connName $LOG) resign..."
|
||||
kill_from_log $LOG && close_device $KEY $DEADDIR
|
||||
if [ "$RESIGN_RATIO" -gt 0 ]; then
|
||||
KEY=$1
|
||||
LOG=${LOGS[$KEY]}
|
||||
if grep -q XWRELAY_ALLHERE $LOG; then
|
||||
if [ 0 -eq $(($RANDOM % $RESIGN_RATIO)) ]; then
|
||||
echo "making $LOG $(connName $LOG) resign..."
|
||||
kill_from_log $LOG && close_device $KEY $DEADDIR
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
check_game() {
|
||||
KEY=$1
|
||||
LOG=${LOGS[$KEY]}
|
||||
|
|
Loading…
Reference in a new issue