forked from github/server
Elfenpferd bewegt sich nicht. Der Code in canride() ist mir immer noch suspekt.
This commit is contained in:
parent
5ddee57978
commit
f0d8d77b22
|
@ -237,7 +237,7 @@ static int
|
||||||
ridingcapacity(unit * u)
|
ridingcapacity(unit * u)
|
||||||
{
|
{
|
||||||
int n;
|
int n;
|
||||||
int wagen, pferde, unicorns;
|
int wagen, pferde;
|
||||||
|
|
||||||
n = 0;
|
n = 0;
|
||||||
|
|
||||||
|
@ -245,15 +245,14 @@ ridingcapacity(unit * u)
|
||||||
* tragen nichts (siehe walkingcapacity). Ein Wagen zählt nur, wenn er
|
* tragen nichts (siehe walkingcapacity). Ein Wagen zählt nur, wenn er
|
||||||
* von zwei Pferden gezogen wird */
|
* von zwei Pferden gezogen wird */
|
||||||
|
|
||||||
unicorns = get_item(u, I_UNICORN);
|
pferde = get_item(u, I_HORSE) + get_item(u, I_UNICORN);
|
||||||
pferde = get_item(u, I_HORSE);
|
|
||||||
pferde = min(pferde, effskill(u, SK_RIDING) * u->number * 2);
|
pferde = min(pferde, effskill(u, SK_RIDING) * u->number * 2);
|
||||||
if (fval(u->race, RCF_HORSE)) pferde += u->number;
|
if (fval(u->race, RCF_HORSE)) pferde += u->number;
|
||||||
|
|
||||||
/* maximal diese Pferde können zum Ziehen benutzt werden */
|
/* maximal diese Pferde können zum Ziehen benutzt werden */
|
||||||
wagen = min(pferde / HORSESNEEDED, get_item(u, I_WAGON));
|
wagen = min(pferde / HORSESNEEDED, get_item(u, I_WAGON));
|
||||||
|
|
||||||
n = wagen * WAGONCAPACITY + (pferde + unicorns) * HORSECAPACITY;
|
n = wagen * WAGONCAPACITY + pferde * HORSECAPACITY;
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -265,8 +264,7 @@ walkingcapacity(const struct unit * u)
|
||||||
/* Das Gewicht, welches die Pferde tragen, plus das Gewicht, welches
|
/* Das Gewicht, welches die Pferde tragen, plus das Gewicht, welches
|
||||||
* die Leute tragen */
|
* die Leute tragen */
|
||||||
|
|
||||||
int pferde = get_item(u, I_HORSE);
|
int pferde = get_item(u, I_HORSE) + get_item(u, I_UNICORN);
|
||||||
int unicorns = get_item(u, I_UNICORN);
|
|
||||||
if (fval(u->race, RCF_HORSE)) {
|
if (fval(u->race, RCF_HORSE)) {
|
||||||
pferde += u->number;
|
pferde += u->number;
|
||||||
personen = 0;
|
personen = 0;
|
||||||
|
@ -297,7 +295,6 @@ walkingcapacity(const struct unit * u)
|
||||||
}
|
}
|
||||||
|
|
||||||
n += pferde * HORSECAPACITY;
|
n += pferde * HORSECAPACITY;
|
||||||
n += unicorns * HORSECAPACITY;
|
|
||||||
n += personen * personcapacity(u);
|
n += personen * personcapacity(u);
|
||||||
/* Goliathwasser */
|
/* Goliathwasser */
|
||||||
tmp = get_effect(u, oldpotiontype[P_STRONG]);
|
tmp = get_effect(u, oldpotiontype[P_STRONG]);
|
||||||
|
@ -328,7 +325,7 @@ canwalk(unit * u)
|
||||||
if (u->faction->no == 0) return E_CANWALK_OK;
|
if (u->faction->no == 0) return E_CANWALK_OK;
|
||||||
|
|
||||||
wagen = get_item(u, I_WAGON);
|
wagen = get_item(u, I_WAGON);
|
||||||
pferde = get_item(u, I_HORSE);
|
pferde = get_item(u, I_HORSE) + get_item(u, I_UNICORN);
|
||||||
|
|
||||||
maxwagen = effskill(u, SK_RIDING) * u->number * 2;
|
maxwagen = effskill(u, SK_RIDING) * u->number * 2;
|
||||||
if (u->race == new_race[RC_TROLL]) {
|
if (u->race == new_race[RC_TROLL]) {
|
||||||
|
@ -378,8 +375,7 @@ canswim(unit *u)
|
||||||
{
|
{
|
||||||
if (get_movement(&u->attribs, MV_CANNOTMOVE)) return false;
|
if (get_movement(&u->attribs, MV_CANNOTMOVE)) return false;
|
||||||
|
|
||||||
if (get_item(u, I_HORSE)) return false;
|
if (get_item(u, I_HORSE) || get_item(u, I_UNICORN)) return false;
|
||||||
if (get_item(u, I_UNICORN)) return false;
|
|
||||||
|
|
||||||
if (get_item(u, I_DOLPHIN) >= u->number && effskill(u, SK_RIDING) >= 4)
|
if (get_item(u, I_DOLPHIN) >= u->number && effskill(u, SK_RIDING) >= 4)
|
||||||
return true;
|
return true;
|
||||||
|
@ -1240,7 +1236,7 @@ travel_route(unit * u, region_list * route_begin, region_list * route_end, order
|
||||||
|
|
||||||
if (rterrain(current)==T_OCEAN || rterrain(next) == T_OCEAN) {
|
if (rterrain(current)==T_OCEAN || rterrain(next) == T_OCEAN) {
|
||||||
/* trying to enter or exit ocean with horses, are we? */
|
/* trying to enter or exit ocean with horses, are we? */
|
||||||
if (get_item(u, I_HORSE) > 0) {
|
if (get_item(u, I_HORSE) > 0 || get_item(u, I_UNICORN) > 0) {
|
||||||
/* tries to do it with horses */
|
/* tries to do it with horses */
|
||||||
if (ord!=NULL) cmistake(u, ord, 67, MSG_MOVE);
|
if (ord!=NULL) cmistake(u, ord, 67, MSG_MOVE);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue