produce-xp abschaltbar gemacht

fehlender return-value in learn()
This commit is contained in:
Enno Rehling 2006-11-04 21:23:45 +00:00
parent 7eaff7d3a5
commit 935aabac4e
4 changed files with 7 additions and 4 deletions

View File

@ -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)) {

View File

@ -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;
} }

View File

@ -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);

View File

@ -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");