From 2e8573c0ec888a33a90abfd2a2cc72d311fde2d8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Mar 2019 19:59:13 -1100 Subject: [PATCH] Fix rogue compile --- src/cc/gamescc.cpp | 13 +++---------- src/cc/rogue_rpc.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/cc/gamescc.cpp b/src/cc/gamescc.cpp index 3e12a7010..4e8660c18 100644 --- a/src/cc/gamescc.cpp +++ b/src/cc/gamescc.cpp @@ -1510,15 +1510,8 @@ UniValue games_finish(uint64_t txfee,struct CCcontract_info *cp,cJSON *params,ch result.push_back(Pair("method",method)); result.push_back(Pair("mygamesaddr",mygamesaddr)); if ( strcmp(method,"bailout") == 0 ) - { funcid = 'Q'; - //mult = 10; //100000; - } - else - { - funcid = 'H'; - //mult = 20; //200000; - } + else funcid = 'H'; if ( params != 0 && (n= cJSON_GetArraySize(params)) > 0 ) { if ( n > 0 ) @@ -1570,13 +1563,13 @@ UniValue games_finish(uint64_t txfee,struct CCcontract_info *cp,cJSON *params,ch fprintf(stderr,"\ncashout %.8f extracted %s\n",(double)cashout/COIN,str); if ( funcid == 'H' && maxplayers > 1 ) { - if ( P.amulet == 0 ) + /*if ( P.amulet == 0 ) { if ( numplayers != maxplayers ) return(cclib_error(result,"numplayers != maxplayers")); else if ( games_playersalive(tmp,tmp,gametxid,maxplayers,gameheight,gametx) > 1 ) return(cclib_error(result,"highlander must be a winner or last one standing")); - } + }*/ cashout += games_buyins(gametxid,maxplayers);//numplayers * buyin; } if ( cashout > 0 ) diff --git a/src/cc/rogue_rpc.cpp b/src/cc/rogue_rpc.cpp index 4b74e21b7..52323adbe 100644 --- a/src/cc/rogue_rpc.cpp +++ b/src/cc/rogue_rpc.cpp @@ -283,7 +283,7 @@ int32_t rogue_iamregistered(int32_t maxplayers,uint256 gametxid,CTransaction tx, return(0); } -int64_t rogue_buyins(uint256 gametxid) +int64_t rogue_buyins(uint256 gametxid,int32_t maxplayers) { int32_t i,vout; uint256 spenttxid,hashBlock; CTransaction spenttx; int64_t buyins = 0; for (i=0; iamulet != 0 ) mult *= 5; dungeonlevel = P->dungeonlevel; @@ -1618,7 +1618,7 @@ bool rogue_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const C if ( funcid == 'H' ) { cashout *= 2; - cashout += rogue_buyins(gametxid); + cashout += rogue_buyins(gametxid,maxplayers); } sprintf(cashstr,"tokentx.(%c) decoded.%d ht.%d txid.%s %.8f vs vout2 %.8f",tokentx,decoded,height,txid.GetHex().c_str(),(double)cashout/COIN,(double)tx.vout[2].nValue/COIN); if ( strcmp(laststr,cashstr) != 0 )