tFix for a FPE bug if you 1. Open the Deal Drugs dialog 2. Get interrupted by a fight 3. Escape to another location 4. Try to select a drug that is no longer available from the Deal Drugs dialog - vaccinewars - be a doctor and try to vaccinate the world
(HTM) git clone git://src.adamsgaard.dk/vaccinewars
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit ef70d3474564a761ea46da48a1ed8843b6386a67
(DIR) parent 05904f5f9ab2e24f493f8193c3685bc72a0a12c7
(HTM) Author: Ben Webb <ben@salilab.org>
Date: Sat, 6 Apr 2002 19:55:52 +0000
Fix for a FPE bug if you
1. Open the Deal Drugs dialog
2. Get interrupted by a fight
3. Escape to another location
4. Try to select a drug that is no longer available from the Deal Drugs dialog
Diffstat:
M src/gui_client/gtk_client.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
---
(DIR) diff --git a/src/gui_client/gtk_client.c b/src/gui_client/gtk_client.c
t@@ -1474,7 +1474,12 @@ static void UpdateDealDialog(void)
gtk_label_set_text(GTK_LABEL(DealDialog.space), text->str);
if (DealDialog.Type == BT_BUY) {
- CanAfford = Play->Cash / Play->Drugs[DrugInd].Price;
+ /* Just in case a price update from the server slips through */
+ if (Play->Drugs[DrugInd].Price == 0) {
+ CanAfford = 0;
+ } else {
+ CanAfford = Play->Cash / Play->Drugs[DrugInd].Price;
+ }
/* Number of the selected drug that you can afford in 'Deal Drugs'
* dialog */