don't allow resignations below a certain point -- which happens to fix

divide-by-zero error.
This commit is contained in:
Andy2 2010-11-22 20:44:28 -08:00
parent daecc807c1
commit 2127394260

View file

@ -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]}