diff --git a/src/common/kernel/battle.c b/src/common/kernel/battle.c index ee45d5223..6b86f87d6 100644 --- a/src/common/kernel/battle.c +++ b/src/common/kernel/battle.c @@ -1963,7 +1963,7 @@ hits(troop at, troop dt, weapon * awp) skdiff = skilldiff(at, dt, dist); /* Verteidiger bekommt eine Rüstung */ armor = select_armor(dt, true); - if (dwp->type->flags & WTF_USESHIELD) { + if (dwp==NULL || (dwp->type->flags & WTF_USESHIELD)) { shield = select_armor(dt, false); } if (contest(skdiff, dt, armor, shield)) { diff --git a/src/common/kernel/eressea.c b/src/common/kernel/eressea.c index 1e6374a27..37398a7cd 100644 --- a/src/common/kernel/eressea.c +++ b/src/common/kernel/eressea.c @@ -134,9 +134,8 @@ MaxAge(void) { } static int -ally_flag(const char * s) +ally_flag(const char * s, int help_mask) { - int help_mask = HelpMask(); if ((help_mask&HELP_MONEY) && strcmp(s, "money")==0) return HELP_MONEY; if ((help_mask&HELP_FIGHT) && strcmp(s, "fight")==0) return HELP_FIGHT; if ((help_mask&HELP_GIVE) && strcmp(s, "give")==0) return HELP_GIVE; @@ -170,13 +169,13 @@ AllianceAuto(void) char * sstr = strdup(str); char * tok = strtok(sstr, " "); while (tok) { - value |= ally_flag(tok); + value |= ally_flag(tok, -1); tok = strtok(NULL, " "); } free(sstr); } } - return value | ~HelpMask(); + return value & HelpMask(); } /** Limits the available help modes @@ -196,7 +195,7 @@ HelpMask(void) char * sstr = strdup(str); char * tok = strtok(sstr, " "); while (tok) { - value |= ally_flag(tok); + value |= ally_flag(tok, -1); tok = strtok(NULL, " "); } free(sstr); @@ -218,11 +217,12 @@ AllianceRestricted(void) char * sstr = strdup(str); char * tok = strtok(sstr, " "); while (tok) { - value |= ally_flag(tok); + value |= ally_flag(tok, -1); tok = strtok(NULL, " "); } free(sstr); } + value &= HelpMask(); } return value; } @@ -878,7 +878,6 @@ autoalliance(const plane * pl, const faction * sf, const faction * f2) if (!init) { init_gms(); init = true; - automode = ~HelpMask(); } if (pl && (pl->flags & PFL_FRIENDLY)) return HELP_ALL; /* if f2 is a gm in this plane, everyone has an auto-help to it */ @@ -896,7 +895,7 @@ autoalliance(const plane * pl, const faction * sf, const faction * f2) if (sf->alliance==f2->alliance) return AllianceAuto(); } - return automode; + return 0; } static int diff --git a/src/common/kernel/eressea.h b/src/common/kernel/eressea.h index 5b5be1615..a4590a049 100644 --- a/src/common/kernel/eressea.h +++ b/src/common/kernel/eressea.h @@ -404,7 +404,6 @@ extern int NewbieImmunity(void); extern int AllianceAuto(void); /* flags that allied factions get automatically */ extern int AllianceRestricted(void); /* flags restricted to allied factions */ extern int HelpMask(void); /* flags restricted to allied factions */ -extern int HelpMask(void); /* flags restricted to allied factions */ extern struct order * default_order(const struct locale * lang); extern int entertainmoney(const struct region * r); diff --git a/src/eressea/tolua/bind_unit.c b/src/eressea/tolua/bind_unit.c index 9fd07969f..dd648598a 100644 --- a/src/eressea/tolua/bind_unit.c +++ b/src/eressea/tolua/bind_unit.c @@ -47,6 +47,7 @@ without prior permission by the authors of Eressea. #include #include +#include static int tolua_unit_get_objects(lua_State* tolua_S) @@ -835,9 +836,14 @@ tolua_unit_create(lua_State* tolua_S) region * r = (region *)tolua_tousertype(tolua_S, 2, 0); int num = (int)tolua_tonumber(tolua_S, 3, 0); if (f && r) { - unit * u = create_unit(r, f, num, f->race, 0, NULL, NULL); - tolua_pushusertype(tolua_S, u, "unit"); - return 1; + const race * rc = f->race; + const char * rcname = tolua_tostring(tolua_S, 4, NULL); + if (rcname) rc = rc_find(rcname); + if (rc) { + unit * u = create_unit(r, f, num, rc, 0, NULL, NULL); + tolua_pushusertype(tolua_S, u, "unit"); + return 1; + } } return 0; } diff --git a/src/res/common/armor.xml b/src/res/common/armor.xml index 75691106e..84a329114 100644 --- a/src/res/common/armor.xml +++ b/src/res/common/armor.xml @@ -1,5 +1,5 @@ - + diff --git a/src/res/common/potions.xml b/src/res/common/potions.xml index b82e14573..f444e5a94 100644 --- a/src/res/common/potions.xml +++ b/src/res/common/potions.xml @@ -59,8 +59,8 @@ - - + + diff --git a/src/res/e2k9.xml b/src/res/e2k9.xml index a0cd1dd08..0374db2d6 100644 --- a/src/res/e2k9.xml +++ b/src/res/e2k9.xml @@ -56,7 +56,7 @@ - + @@ -96,11 +96,11 @@ + - @@ -138,13 +138,14 @@ + - + diff --git a/src/res/e2k9/equipment.xml b/src/res/e2k9/equipment.xml index 59fa6d5a4..b186f36e6 100644 --- a/src/res/e2k9/equipment.xml +++ b/src/res/e2k9/equipment.xml @@ -15,4 +15,48 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/res/e2k9/items.xml b/src/res/e2k9/items.xml index c2351510a..81d11c5c1 100644 --- a/src/res/e2k9/items.xml +++ b/src/res/e2k9/items.xml @@ -1,14 +1,64 @@ - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + diff --git a/src/res/e2k9/races.xml b/src/res/e2k9/races.xml index 3a6975d76..2800c524a 100644 --- a/src/res/e2k9/races.xml +++ b/src/res/e2k9/races.xml @@ -13,6 +13,7 @@ + @@ -37,6 +38,7 @@ + @@ -59,6 +61,7 @@ + @@ -81,6 +84,7 @@ + @@ -103,6 +107,7 @@ + @@ -127,6 +132,7 @@ + @@ -148,6 +154,7 @@ + @@ -171,6 +178,7 @@ + @@ -179,7 +187,6 @@ - diff --git a/src/res/e2k9/strings.xml b/src/res/e2k9/strings.xml index 78a59b7bb..52b5ada7b 100644 --- a/src/res/e2k9/strings.xml +++ b/src/res/e2k9/strings.xml @@ -7,7 +7,7 @@ _a: including article (ein Troll, a troll) --> - + des dritten Zeitalters the third age