diff --git a/src/land.c b/src/land.c index 2b55a61..dd7692e 100644 --- a/src/land.c +++ b/src/land.c @@ -417,7 +417,7 @@ static int outfit_canBuy(Outfit* outfit, int q, int errmsg) { return 0; } /* Not enough $$. */ - else if(q*outfit->price >= player->credits) { + else if(q*outfit->price > player->credits) { if(errmsg != 0) { credits2str(buf, q*outfit->price - player->credits, 2); dialogue_alert("You need %s more SCred.", buf); @@ -679,6 +679,12 @@ static void shipyard_buy(unsigned int wid, char* str) { shipname = toolkit_getList(wid, "iarShipyard"); ship = ship_get(shipname); + /* Must have enough money. */ + if(ship->price > player->credits) { + dialogue_alert("Not enough credits!"); + return; + } + if(pilot_cargoUsed(player) > ship->cap_cargo) { dialogue_alert("You won't have space to move your current cargo onto the new ship."); return;