move entertainmoney to economy

This commit is contained in:
Enno Rehling 2016-11-22 12:22:07 +01:00
parent ec4060cb9a
commit 925d65c206
5 changed files with 20 additions and 20 deletions

View File

@ -112,6 +112,23 @@ static void recruit_init(void)
} }
} }
int entertainmoney(const region * r)
{
double n;
if (is_cursed(r->attribs, C_DEPRESSION, 0)) {
return 0;
}
n = rmoney(r) / (double)ENTERTAINFRACTION;
if (is_cursed(r->attribs, C_GENEROUS, 0)) {
n *= get_curseeffect(r->attribs, C_GENEROUS, 0);
}
return (int)n;
}
int income(const unit * u) int income(const unit * u)
{ {
const race *rc = u_race(u); const race *rc = u_race(u);

View File

@ -48,6 +48,7 @@ extern "C" {
struct request; struct request;
int income(const struct unit *u); int income(const struct unit *u);
int entertainmoney(const struct region *r);
void economics(struct region *r); void economics(struct region *r);
void produce(struct region *r); void produce(struct region *r);

View File

@ -1,8 +1,8 @@
#include <platform.h> #include <platform.h>
#include <kernel/config.h>
#include "items.h" #include "items.h"
#include "study.h" #include "study.h"
#include "economy.h"
#include "move.h" #include "move.h"
#include "magic.h" #include "magic.h"
@ -137,7 +137,7 @@ struct order *ord)
while (*ap && force > 0) { while (*ap && force > 0) {
curse *c; curse *c;
attrib *a = *ap; attrib *a = *ap;
if (!fval(a->type, ATF_CURSE)) { if (!(a->type->flags & ATF_CURSE)) {
do { do {
ap = &(*ap)->next; ap = &(*ap)->next;
} while (*ap && a->type == (*ap)->type); } while (*ap && a->type == (*ap)->type);

View File

@ -941,23 +941,6 @@ order *default_order(const struct locale *lang)
return result ? copy_order(result) : 0; return result ? copy_order(result) : 0;
} }
int entertainmoney(const region * r)
{
double n;
if (is_cursed(r->attribs, C_DEPRESSION, 0)) {
return 0;
}
n = rmoney(r) / (double)ENTERTAINFRACTION;
if (is_cursed(r->attribs, C_GENEROUS, 0)) {
n *= get_curseeffect(r->attribs, C_GENEROUS, 0);
}
return (int)n;
}
int rule_give(void) int rule_give(void)
{ {
static int config; static int config;

View File

@ -147,7 +147,6 @@ struct param;
struct order *default_order(const struct locale *lang); struct order *default_order(const struct locale *lang);
int entertainmoney(const struct region *r);
void init_parameters(struct locale *lang); void init_parameters(struct locale *lang);
void free_gamedata(void); void free_gamedata(void);