forked from github/server
move entertainmoney to economy
This commit is contained in:
parent
ec4060cb9a
commit
925d65c206
|
@ -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)
|
||||
{
|
||||
const race *rc = u_race(u);
|
||||
|
|
|
@ -48,6 +48,7 @@ extern "C" {
|
|||
struct request;
|
||||
|
||||
int income(const struct unit *u);
|
||||
int entertainmoney(const struct region *r);
|
||||
|
||||
void economics(struct region *r);
|
||||
void produce(struct region *r);
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#include <platform.h>
|
||||
#include <kernel/config.h>
|
||||
#include "items.h"
|
||||
|
||||
#include "study.h"
|
||||
#include "economy.h"
|
||||
#include "move.h"
|
||||
#include "magic.h"
|
||||
|
||||
|
@ -137,7 +137,7 @@ struct order *ord)
|
|||
while (*ap && force > 0) {
|
||||
curse *c;
|
||||
attrib *a = *ap;
|
||||
if (!fval(a->type, ATF_CURSE)) {
|
||||
if (!(a->type->flags & ATF_CURSE)) {
|
||||
do {
|
||||
ap = &(*ap)->next;
|
||||
} while (*ap && a->type == (*ap)->type);
|
||||
|
|
|
@ -941,23 +941,6 @@ order *default_order(const struct locale *lang)
|
|||
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)
|
||||
{
|
||||
static int config;
|
||||
|
|
|
@ -147,7 +147,6 @@ struct param;
|
|||
|
||||
struct order *default_order(const struct locale *lang);
|
||||
|
||||
int entertainmoney(const struct region *r);
|
||||
void init_parameters(struct locale *lang);
|
||||
|
||||
void free_gamedata(void);
|
||||
|
|
Loading…
Reference in New Issue