forked from github/server
produce-xp abschaltbar gemacht
fehlender return-value in learn()
This commit is contained in:
parent
7eaff7d3a5
commit
935aabac4e
|
@ -454,7 +454,7 @@ learn_cmd(unit * u, order * ord)
|
||||||
skill_t sk;
|
skill_t sk;
|
||||||
int maxalchemy = 0;
|
int maxalchemy = 0;
|
||||||
|
|
||||||
if (u->number==0) return;
|
if (u->number==0) return 0;
|
||||||
if (fval(r->terrain, SEA_REGION)) {
|
if (fval(r->terrain, SEA_REGION)) {
|
||||||
/* sonderbehandlung aller die auf Ozeanen lernen können */
|
/* sonderbehandlung aller die auf Ozeanen lernen können */
|
||||||
if (u->race!=new_race[RC_AQUARIAN] && !(u->race->flags & RCF_SWIM)) {
|
if (u->race!=new_race[RC_AQUARIAN] && !(u->race->flags & RCF_SWIM)) {
|
||||||
|
|
|
@ -3052,8 +3052,10 @@ reorder_owners(region * r)
|
||||||
int
|
int
|
||||||
produceexp(struct unit * u, skill_t sk, int n)
|
produceexp(struct unit * u, skill_t sk, int n)
|
||||||
{
|
{
|
||||||
|
if (global.producexpchance>0.0F) {
|
||||||
if (n==0 || !playerrace(u->race)) return 0;
|
if (n==0 || !playerrace(u->race)) return 0;
|
||||||
learn_skill(u, sk, PRODUCEEXP/30.0);
|
learn_skill(u, sk, global.producexpchance);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -336,7 +336,6 @@ extern void plagues(struct region * r, boolean ismagic);
|
||||||
#define CMDSIZE (DISPLAYSIZE*2+1)
|
#define CMDSIZE (DISPLAYSIZE*2+1)
|
||||||
#define STARTMONEY 5000
|
#define STARTMONEY 5000
|
||||||
|
|
||||||
#define PRODUCEEXP 10
|
|
||||||
#define TAVERN_MAINTENANCE 14
|
#define TAVERN_MAINTENANCE 14
|
||||||
/* Man gibt in einer Taverne mehr Geld aus! */
|
/* Man gibt in einer Taverne mehr Geld aus! */
|
||||||
|
|
||||||
|
@ -1088,6 +1087,7 @@ typedef struct settings {
|
||||||
boolean disabled[MAXKEYWORDS];
|
boolean disabled[MAXKEYWORDS];
|
||||||
struct param * parameters;
|
struct param * parameters;
|
||||||
void * vm_state;
|
void * vm_state;
|
||||||
|
float producexpchance;
|
||||||
|
|
||||||
struct global_functions {
|
struct global_functions {
|
||||||
int (*wage)(const struct region *r, const struct faction * f, const struct race * rc);
|
int (*wage)(const struct region *r, const struct faction * f, const struct race * rc);
|
||||||
|
|
|
@ -1896,6 +1896,7 @@ parse_main(xmlDocPtr doc)
|
||||||
}
|
}
|
||||||
|
|
||||||
global.unitsperalliance = xml_bvalue(node, "unitsperalliance", false);
|
global.unitsperalliance = xml_bvalue(node, "unitsperalliance", false);
|
||||||
|
global.producexpchance = (float)xml_fvalue(node, "learningbydoing", 1.0/3);
|
||||||
global.maxunits = xml_ivalue(node, "units", INT_MAX);
|
global.maxunits = xml_ivalue(node, "units", INT_MAX);
|
||||||
|
|
||||||
property = xmlGetProp(node, BAD_CAST "name");
|
property = xmlGetProp(node, BAD_CAST "name");
|
||||||
|
|
Loading…
Reference in New Issue