From b125e84adae52b9729186f6e393b18a05552e784 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Fri, 1 Jul 2005 22:54:14 +0000 Subject: [PATCH] http://eressea.upb.de/mantis/view.php?id=586 Fliegende Einheiten ertrinken MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Aussserdem: Verschieben der Astralraumänderungen (wg. schwerem Magiepatzer) --- src/common/gamecode/laws.c | 2 +- src/common/gamecode/randenc.c | 2 +- src/common/kernel/movement.c | 19 +++++++------------ src/common/kernel/movement.h | 1 + src/common/kernel/spell.c | 2 +- src/common/settings-eressea.h | 2 +- 6 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/common/gamecode/laws.c b/src/common/gamecode/laws.c index cf3e2dd6c..83a78525c 100644 --- a/src/common/gamecode/laws.c +++ b/src/common/gamecode/laws.c @@ -3733,7 +3733,7 @@ monthly_healing(void) if (fval(u, UFL_HUNGER)) continue; if (fspecial(u->faction, FS_UNDEAD)) continue; - if (rterrain(r)==T_OCEAN && u->ship==NULL && !canswim(u)) continue; + if (rterrain(r)==T_OCEAN && u->ship==NULL && !(canswim(u) || canfly(u))) continue; if(fspecial(u->faction, FS_REGENERATION)) { u->hp = umhp; diff --git a/src/common/gamecode/randenc.c b/src/common/gamecode/randenc.c index 1d7283e39..8f52eaa6c 100644 --- a/src/common/gamecode/randenc.c +++ b/src/common/gamecode/randenc.c @@ -737,7 +737,7 @@ drown(region *r) ADDMSG(&u->faction->msgs, new_message(u->faction, "drown_amphibian_nodead%u:unit%r:region",u, r)); } - } else if (!canswim(u)) { + } else if (!(canswim(u) || canfly(u))) { scale_number(u, 0); ADDMSG(&u->faction->msgs, new_message(u->faction, "drown%u:unit%r:region", u, r)); diff --git a/src/common/kernel/movement.c b/src/common/kernel/movement.c index 7ed9464ca..6fe4c1334 100644 --- a/src/common/kernel/movement.c +++ b/src/common/kernel/movement.c @@ -356,10 +356,6 @@ canwalk(unit * u) boolean canfly(unit *u) { - if (get_movement(&u->attribs, MV_CANNOTMOVE)) return false; - - if (get_item(u, I_HORSE) || get_item(u, I_UNICORN)) return false; - if (get_item(u, I_PEGASUS) >= u->number && effskill(u, SK_RIDING) >= 4) return true; @@ -373,10 +369,6 @@ canfly(unit *u) boolean canswim(unit *u) { - if (get_movement(&u->attribs, MV_CANNOTMOVE)) return false; - - if (get_item(u, I_HORSE) || get_item(u, I_UNICORN)) return false; - if (get_item(u, I_DOLPHIN) >= u->number && effskill(u, SK_RIDING) >= 4) return true; @@ -1247,11 +1239,14 @@ travel_route(unit * u, region_list * route_begin, region_list * route_end, order /* Ozeanfelder können nur von Einheiten mit Schwimmen und ohne * Pferde betreten werden. */ - if (rterrain(next) == T_OCEAN && !canswim(u)) { - ADDMSG(&u->faction->msgs, msg_message("detectocean", - "unit region", u, next)); - break; + if (rterrain(next) == T_OCEAN) { + if (!(canswim(u) || canfly(u))) { + ADDMSG(&u->faction->msgs, msg_message("detectocean", + "unit region", u, next)); + break; + } } + } /* movement blocked by a wall */ diff --git a/src/common/kernel/movement.h b/src/common/kernel/movement.h index 6cbc57ca5..7ed65a916 100644 --- a/src/common/kernel/movement.h +++ b/src/common/kernel/movement.h @@ -55,6 +55,7 @@ extern void run_to(struct unit * u, struct region * to); extern struct unit *is_guarded(struct region * r, struct unit * u, unsigned int mask); extern int enoughsailors(const struct ship * sh, const struct region * r); extern boolean canswim(struct unit *u); +extern boolean canfly(struct unit *u); extern struct unit *get_captain(const struct ship * sh); extern void travelthru(const struct unit * u, struct region * r); extern struct ship * move_ship(struct ship * sh, struct region * from, struct region * to, struct region_list * route); diff --git a/src/common/kernel/spell.c b/src/common/kernel/spell.c index 7b82fbc7c..16f47aef0 100644 --- a/src/common/kernel/spell.c +++ b/src/common/kernel/spell.c @@ -5553,7 +5553,7 @@ sp_sweetdreams(castorder *co) /* Zieleinheit */ u = pa->param[n]->data.u; - if (!ucontact(u, mage, HELP_GUARD)) { + if (!ucontact(u, mage)) { cmistake(mage, co->order, 40, MSG_EVENT); continue; } diff --git a/src/common/settings-eressea.h b/src/common/settings-eressea.h index ba2f53617..6a991d175 100644 --- a/src/common/settings-eressea.h +++ b/src/common/settings-eressea.h @@ -37,7 +37,7 @@ #define HUNGER_REDUCES_SKILL /* Hunger reduziert den Talentwert auf die Hälfte */ -#define ASTRAL_ITEM_RESTRICTIONS /* keine grossen dinge im astralraum */ +#undef ASTRAL_ITEM_RESTRICTIONS /* keine grossen dinge im astralraum */ #define MUSEUM_MODULE #define ARENA_MODULE