summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2016-05-23 22:30:24 +0200
committeremkael <emkael@tlen.pl>2016-05-23 22:30:24 +0200
commit666393fc1619daabdba4a187493479e2c1f82c2a (patch)
treef5c409f1bfbf193ec78bdbdc20a4ab910367755d
parent90ccfb4a70beac9deeb4501914fd90e9c6a6cb05 (diff)
* BCalc error checks
-rw-r--r--DDTable.cs6
1 files changed, 6 insertions, 0 deletions
diff --git a/DDTable.cs b/DDTable.cs
index 78d58b9..31bbd82 100644
--- a/DDTable.cs
+++ b/DDTable.cs
@@ -62,8 +62,14 @@ namespace BCDD
{
BCalcWrapper.bcalcDDS_setPlayerOnLeadAndReset(solver, BCalcWrapper.bcalc_declarerToLeader(player));
result[player, denom] = 13 - BCalcWrapper.bcalcDDS_getTricksToTake(solver);
+ String error = Marshal.PtrToStringAuto(BCalcWrapper.bcalcDDS_getLastError(solver));
+ if (error != null)
+ {
+ throw new DDTableInvalidException("BCalc error: " + error);
+ }
}
}
+ BCalcWrapper.bcalcDDS_delete(solver);
return this.validateTable(result);
}