From 492aba543bb79847268d54c7d4247d9a4a8d0a8e Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 5 Feb 2017 19:30:09 +0100 Subject: [PATCH] delete at_scare delete dead code (race.attribs has no at_skillmod) delete race.attribs --- src/attributes/attributes.c | 5 ----- src/attributes/attributes.h | 1 - src/battle.c | 4 ---- src/kernel/race.c | 9 +-------- src/kernel/race.h | 1 - 5 files changed, 1 insertion(+), 19 deletions(-) diff --git a/src/attributes/attributes.c b/src/attributes/attributes.c index 8e9b22139..42f5247fe 100644 --- a/src/attributes/attributes.c +++ b/src/attributes/attributes.c @@ -58,10 +58,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include -attrib_type at_scare = { // monster scares peasants - "scare", NULL, NULL, NULL, a_writeint, a_readint -}; - attrib_type at_unitdissolve = { "unitdissolve", NULL, NULL, NULL, a_writechars, a_readchars }; @@ -78,7 +74,6 @@ static int read_ext(attrib * a, void *owner, gamedata *data) void register_attributes(void) { /* Alle speicherbaren Attribute müssen hier registriert werden */ - at_register(&at_scare); at_register(&at_shiptrail); at_register(&at_familiar); at_register(&at_familiarmage); diff --git a/src/attributes/attributes.h b/src/attributes/attributes.h index 91184ad98..4ec3150ec 100644 --- a/src/attributes/attributes.h +++ b/src/attributes/attributes.h @@ -23,7 +23,6 @@ extern "C" { #endif struct attrib_type; - extern struct attrib_type at_scare; extern void register_attributes(void); #ifdef __cplusplus diff --git a/src/battle.c b/src/battle.c index 9316d35dd..04e72d92c 100644 --- a/src/battle.c +++ b/src/battle.c @@ -760,10 +760,6 @@ bool missile) if (is_riding(t) && (wtype == NULL || (fval(wtype, WTF_HORSEBONUS) && !fval(wtype, WTF_MISSILE)))) { skill += CavalryBonus(tu, enemy, BONUS_SKILL); - if (wtype) - skill = - skillmod(u_race(tu)->attribs, tu, tu->region, wtype->skill, skill, - SMF_RIDING); } if (t.index < tf->elvenhorses) { diff --git a/src/kernel/race.c b/src/kernel/race.c index b7c52d169..9a5ce84c2 100644 --- a/src/kernel/race.c +++ b/src/kernel/race.c @@ -48,7 +48,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include /* attrib includes */ -#include #include /* libc includes */ @@ -298,8 +297,7 @@ int rc_armor_bonus(const race *rc) int rc_scare(const struct race *rc) { - attrib *a = a_find(rc->attribs, &at_scare); - return a ? a->data.i : 0; + return get_param_int(rc->parameters, "ai.scare", 0); } int rc_migrants_formula(const race *rc) @@ -311,11 +309,6 @@ void rc_set_param(struct race *rc, const char *key, const char *value) { if (strcmp(key, "recruit_multi") == 0) { rc->recruit_multi = atof(value); } - else if (strcmp(key, "ai.scare") == 0) { - attrib *a = a_new(&at_scare); - a->data.i = atoi(value); - a_add(&rc->attribs, a); - } else if (strcmp(key, "migrants.formula") == 0) { if (value[0] == '1') { rc->flags |= RCF_MIGRANTS; diff --git a/src/kernel/race.h b/src/kernel/race.h index 6a4feb269..906b56808 100644 --- a/src/kernel/race.h +++ b/src/kernel/race.h @@ -154,7 +154,6 @@ extern "C" { void(*init_familiar) (struct unit *); const struct race *familiars[MAXMAGIETYP]; - struct attrib *attribs; struct race *next; } race;