forked from github/server
übertrag aus beta-1-0 nach dev - magieparsing
This commit is contained in:
parent
d91c4e7831
commit
bc899524f3
|
@ -140,6 +140,11 @@ teach_unit(unit * teacher, unit * student, int teaching, skill_t sk, boolean rep
|
||||||
* n ist die Anzahl zusätzlich gelernter Tage. n darf max. die Differenz
|
* n ist die Anzahl zusätzlich gelernter Tage. n darf max. die Differenz
|
||||||
* von schon gelernten Tagen zum max(30 Tage pro Mann) betragen. */
|
* von schon gelernten Tagen zum max(30 Tage pro Mann) betragen. */
|
||||||
|
|
||||||
|
if (magic_lowskill(student)){
|
||||||
|
cmistake(teacher, teacher->thisorder, 274, MSG_EVENT);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef RANDOMIZED_LEARNING
|
#ifdef RANDOMIZED_LEARNING
|
||||||
n = student->number * dice(2,30);
|
n = student->number * dice(2,30);
|
||||||
#else
|
#else
|
||||||
|
@ -238,11 +243,6 @@ teach(region * r, unit * u)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (magic_lowskill(u2)){
|
|
||||||
cmistake(u, u->thisorder, 274, MSG_EVENT);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
teaching = u->number * 30 * TEACHNUMBER;
|
teaching = u->number * 30 * TEACHNUMBER;
|
||||||
|
|
||||||
if ((i = get_effect(u, oldpotiontype[P_FOOL])) > 0) { /* Trank "Dumpfbackenbrot" */
|
if ((i = get_effect(u, oldpotiontype[P_FOOL])) > 0) { /* Trank "Dumpfbackenbrot" */
|
||||||
|
|
|
@ -1930,7 +1930,7 @@ spellparameter *
|
||||||
add_spellparameter(region *target_r, unit *u, const char *syntax,
|
add_spellparameter(region *target_r, unit *u, const char *syntax,
|
||||||
char *s, int skip)
|
char *s, int skip)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 1;
|
||||||
int c = 0;
|
int c = 0;
|
||||||
int l = 0;
|
int l = 0;
|
||||||
char *tbuf, *token;
|
char *tbuf, *token;
|
||||||
|
@ -1970,7 +1970,7 @@ add_spellparameter(region *target_r, unit *u, const char *syntax,
|
||||||
strcpy(tbuf, s);
|
strcpy(tbuf, s);
|
||||||
token = strtok (tbuf, " ");
|
token = strtok (tbuf, " ");
|
||||||
while(token && syntax[c] != 0) {
|
while(token && syntax[c] != 0) {
|
||||||
if (i >= skip) {
|
if (i > skip) {
|
||||||
if (syntax[c] == '+') {
|
if (syntax[c] == '+') {
|
||||||
/* das vorhergehende Element kommt ein oder mehrmals vor, wir
|
/* das vorhergehende Element kommt ein oder mehrmals vor, wir
|
||||||
* springen zum key zurück */
|
* springen zum key zurück */
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include "base36.h"
|
#include "base36.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
#ifdef HAVE_STRTOL
|
#ifdef HAVE_STRTOL
|
||||||
int
|
int
|
||||||
|
@ -36,7 +37,7 @@ int
|
||||||
atoi36(const char * s)
|
atoi36(const char * s)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
assert(s);
|
||||||
if(!(*s)) return 0;
|
if(!(*s)) return 0;
|
||||||
|
|
||||||
while(!isalnum((int)*s)) ++s;
|
while(!isalnum((int)*s)) ++s;
|
||||||
|
|
Loading…
Reference in New Issue