delete at_scare

delete dead code (race.attribs has no at_skillmod)
delete race.attribs
This commit is contained in:
Enno Rehling 2017-02-05 19:30:09 +01:00
parent 67414f29eb
commit 492aba543b
5 changed files with 1 additions and 19 deletions

View File

@ -58,10 +58,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <storage.h>
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);

View File

@ -23,7 +23,6 @@ extern "C" {
#endif
struct attrib_type;
extern struct attrib_type at_scare;
extern void register_attributes(void);
#ifdef __cplusplus

View File

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

View File

@ -48,7 +48,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <storage.h>
/* attrib includes */
#include <attributes/attributes.h>
#include <attributes/raceprefix.h>
/* 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;

View File

@ -154,7 +154,6 @@ extern "C" {
void(*init_familiar) (struct unit *);
const struct race *familiars[MAXMAGIETYP];
struct attrib *attribs;
struct race *next;
} race;