From 666393fc1619daabdba4a187493479e2c1f82c2a Mon Sep 17 00:00:00 2001 From: emkael Date: Mon, 23 May 2016 22:30:24 +0200 Subject: * BCalc error checks --- DDTable.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'DDTable.cs') 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); } -- cgit v1.2.3