Remove unused check_cost()

This commit is contained in:
Markus Armbruster 2008-02-17 08:47:51 +01:00
parent 8227d8c8ef
commit 44f6656e2f
2 changed files with 0 additions and 26 deletions

View file

@ -419,7 +419,6 @@ extern int check_loan_ok(struct lonstr *);
extern int check_trade_ok(struct trdstr *);
/* chkmoney.c */
extern int chkmoney(long, long, char *);
extern int check_cost(int, int, long, int *, char *);
/* coastal.c */
extern void set_coastal(struct sctstr *, int, int);
/* control.c */

View file

@ -54,28 +54,3 @@ chkmoney(long cost, long cash, char *argp)
}
return 0;
}
int
check_cost(int looping, int cost, long cash, int *warnedp,
char *argp)
{
char buf[1024];
char *p;
if (looping && cash > 0 && player->dolcost + cost > cash
&& *warnedp < 2) {
*warnedp = 2;
pr("You will go broke! (it will cost $%d and you only have $%ld)\n", cost, cash - (long)player->dolcost);
p = getstarg(argp, "Are you sure you wish to continue? ", buf);
if (p == 0 || *p != 'y')
return 1;
}
player->dolcost += cost;
if (looping && cash > 0 && player->dolcost > cash / 2 && *warnedp < 1) {
*warnedp = 1;
pr("WARNING. You have just spent over half of your money.\n");
pr("You started with $%ld and now you only have $%ld left\n",
cash, cash - (long)player->dolcost);
}
return 0;
}