[Add] Added more price checks.
This commit is contained in:
parent
5bda353312
commit
cf9567d79f
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user