From 6ec99af4d6d84276f437dc3b6a11ace1bac3dec7 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 19 Sep 2016 15:53:31 +0200 Subject: [PATCH] mark all three major dragon types as RCF_DRAGON. use RCF_DRGON flag to detemine BP_DRAGON speed. --- res/eressea/races.xml | 2 +- res/races/dragon.xml | 2 +- res/races/wyrm.xml | 2 +- res/races/youngdragon.xml | 2 +- src/move.c | 11 +++++------ 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/res/eressea/races.xml b/res/eressea/races.xml index 201a6a797..b29b84ede 100644 --- a/res/eressea/races.xml +++ b/res/eressea/races.xml @@ -742,7 +742,7 @@ - + diff --git a/res/races/dragon.xml b/res/races/dragon.xml index 7a6dee3a7..a1f347105 100644 --- a/res/races/dragon.xml +++ b/res/races/dragon.xml @@ -1,5 +1,5 @@ +"6" damage="2d30" unarmedattack="0" unarmeddefense="0" attackmodifier="7" defensemodifier="7" scarepeasants="yes" fly="yes" walk="yes" teach="no" getitem="yes" resistbash="yes" dragon="yes"> diff --git a/res/races/wyrm.xml b/res/races/wyrm.xml index 8569f4c19..5c63b0fb6 100644 --- a/res/races/wyrm.xml +++ b/res/races/wyrm.xml @@ -1,4 +1,4 @@ - + diff --git a/res/races/youngdragon.xml b/res/races/youngdragon.xml index 541f68142..fe29bbfde 100644 --- a/res/races/youngdragon.xml +++ b/res/races/youngdragon.xml @@ -1,4 +1,4 @@ - + diff --git a/src/move.c b/src/move.c index c95775b5a..a97bc5425 100644 --- a/src/move.c +++ b/src/move.c @@ -1465,15 +1465,14 @@ static void make_route(unit * u, order * ord, region_list ** routep) static int movement_speed(unit * u) { int mp = BP_WALKING; - double dk = u_race(u)->speed; - + const race *rc = u_race(u); + double dk = rc->speed; assert(u->number); /* dragons have a fixed speed, and no other effects work on them: */ - switch (old_race(u_race(u))) { - case RC_DRAGON: - case RC_WYRM: - case RC_FIREDRAGON: + if (fval(rc, RCF_DRAGON)) { return BP_DRAGON; + } + switch (old_race(u_race(u))) { case RC_BIRTHDAYDRAGON: case RC_SONGDRAGON: mp = BP_DRAGON;