tDivide by zero error in BuyObject fixed - probably... - vaccinewars - be a doctor and try to vaccinate the world
HTML git clone git://src.adamsgaard.dk/vaccinewars
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit aeedec1cb408ccf5b8a2359cbe2b73e000e07879
DIR parent 329fbfb0e6375f7b2cf783a6afa9bb9e188ebfd7
HTML Author: Ben Webb <ben@salilab.org>
Date: Fri, 24 Nov 2000 17:21:37 +0000
Divide by zero error in BuyObject fixed - probably...
Diffstat:
M src/serverside.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
DIR diff --git a/src/serverside.c b/src/serverside.c
t@@ -1890,7 +1890,7 @@ void BuyObject(Player *From,char *data) {
amount<0) && From->Cash >= amount*From->Drugs[index].Price) {
if (amount>0) {
From->Drugs[index].TotalValue+=amount*From->Drugs[index].Price;
- } else {
+ } else if (From->Drugs[index].Carried!=0) {
From->Drugs[index].TotalValue = From->Drugs[index].TotalValue*
(From->Drugs[index].Carried+amount)/From->Drugs[index].Carried;
}