From 30e89fe1c81e0097cf12526734f703fc560d4436 Mon Sep 17 00:00:00 2001 From: Allanis Date: Mon, 10 Mar 2014 14:53:46 +0000 Subject: [PATCH] [Add] Added a check for negative prices. --- src/ship.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ship.c b/src/ship.c index ba96760..77c1b08 100644 --- a/src/ship.c +++ b/src/ship.c @@ -213,6 +213,11 @@ int ship_basePrice(Ship* s) { for(o = s->outfit; o != NULL; o = o->next) price -= o->quantity * o->data->price; + if(price < 0) { + WARN("Negative ship base price!"); + price = 0; + } + return price; }