Merge pull request #342 from TurnerSE/bug/CID22449

Bug/cid22449
This commit is contained in:
Enno Rehling 2015-11-02 15:55:44 +01:00
commit 0b00bfecdf
2 changed files with 3 additions and 36 deletions

View File

@ -1212,23 +1212,6 @@
<text locale="en">"$unit($unit) dies from poison damage taken in $region($region)."</text>
</message>
<message name="drown_amphibian_dead" section="events">
<type>
<arg name="amount" type="int"/>
<arg name="unit" type="unit"/>
<arg name="region" type="region"/>
</type>
<text locale="de">"$int($amount) Personen in $unit($unit) in $region($region) ertrinken."</text>
<text locale="en">"$int($amount) people in $unit($unit) in $region($region) drown."</text>
</message>
<message name="drown_amphibian_nodead" section="events">
<type>
<arg name="unit" type="unit"/>
<arg name="region" type="region"/>
</type>
<text locale="de">"$unit($unit) nimmt Schaden auf dem Wasser in $region($region)."</text>
<text locale="en">"$unit($unit) is taking damage on the water."</text>
</message>
<message name="wand_of_tears_usage" section="events">
<type>
<arg name="unit" type="unit"/>

View File

@ -528,28 +528,12 @@ void drown(region * r)
unit **up = up = &r->units;
while (*up) {
unit *u = *up;
int amphibian_level = 0;
if (u->ship || u_race(u) == get_race(RC_SPELL) || u->number == 0) {
up = &u->next;
continue;
}
if (amphibian_level) {
int dead = damage_unit(u, "5d1", false, false);
if (dead) {
ADDMSG(&u->faction->msgs, msg_message("drown_amphibian_dead",
"amount unit region", dead, u, r));
}
else {
ADDMSG(&u->faction->msgs, msg_message("drown_amphibian_nodead",
"unit region", u, r));
}
}
else if (!(canswim(u) || canfly(u))) {
if (!(u->ship || u_race(u) == get_race(RC_SPELL) || u->number == 0 || canswim(u) || canfly(u))) {
scale_number(u, 0);
ADDMSG(&u->faction->msgs, msg_message("drown", "unit region", u, r));
}
if (*up == u)
up = &u->next;
}
remove_empty_units_in_region(r);