X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=src%2Fserver%2Fdispense.c;h=b0a59364e5c8ae63479e151adfbf66d3b8148157;hb=0e15ed888a4d398530a74a6b713414e649767358;hp=c3426fd718a59104d00fa94869281f989cb77313;hpb=8a516dd60ab15cf514481c74dd087a294915565d;p=tpg%2Fopendispense2.git diff --git a/src/server/dispense.c b/src/server/dispense.c index c3426fd..b0a5936 100644 --- a/src/server/dispense.c +++ b/src/server/dispense.c @@ -120,6 +120,10 @@ int DispenseGive(int ActualUser, int SrcUser, int DestUser, int Ammount, const c char *actualUsername; char *srcName, *dstName; + // HACK: Naming a slot "dead" disables it (catch for snack) + if( strcmp(ReasonGiven, "dead") == 0 ) + return 1; + if( Ammount < 0 ) return 1; // Um... negative give? Not on my watch! ret = _Transfer( SrcUser, DestUser, Ammount, ReasonGiven ); @@ -315,9 +319,12 @@ int _GetMinBalance(int Account) /** * \brief Check if a transfer is possible + * \return Boolean success */ int _CanTransfer(int Source, int Destination, int Ammount) { + if( Bank_GetFlags(Source) & USER_FLAG_DISABLED ) + return 0; if( Ammount > 0 ) { if( Bank_GetBalance(Source) - Ammount < _GetMinBalance(Source) )