[Add] Added a check for negative prices.
This commit is contained in:
parent
15216c7544
commit
30e89fe1c8
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user