- Bugfix Patzermeldungen,

- Entfernte Befehle kriegen next=NULL, assert desselben.
This commit is contained in:
Enno Rehling 2004-06-27 12:19:58 +00:00
parent df476c5d7c
commit 075ab8d997
8 changed files with 93 additions and 88 deletions

View File

@ -3237,6 +3237,7 @@ new_units (void)
order * ord = *ordp;
if (get_keyword(ord) == K_END) break;
*ordp = ord->next;
ord->next = NULL;
free_order(ord);
}
continue;
@ -3543,6 +3544,7 @@ defaultorders (void)
set_order(&u->lastorder, parse_order(getstrtoken(), u->faction->locale));
free_order(u->lastorder); /* parse_order & set_order have both increased the refcount */
*ordp = ord->next;
ord->next = NULL;
free_order(ord);
}
else ordp = &ord->next;

View File

@ -1248,6 +1248,7 @@ do_misc(boolean lasttry)
* erfolgreich und wir löschen ihn, damit er im
* zweiten Versuch nicht nochmal ausgeführt wird. */
*ordp = ord->next;
ord->next = NULL;
free_order(ord);
leave(r, u);
u->building = b;

View File

@ -63,6 +63,7 @@ void
free_order(order * ord)
{
if (ord!=NULL && --ord->_refcount==0) {
assert(ord->next==NULL);
if (ord->_str!=NULL) free(ord->_str);
free(ord);
}
@ -89,6 +90,7 @@ free_orders(order ** olist)
while (*olist) {
order * ord = *olist;
*olist = ord->next;
ord->next = NULL;
free_order(ord);
}
}

View File

@ -195,11 +195,11 @@ magicanalyse_region(region *r, unit *mage, double force)
if (chance(probability)) { /* Analyse geglückt */
if(c->flag & CURSE_NOAGE) {
ADDMSG(&mage->faction->msgs, msg_message(
"analyse_region_noage", "mage region spell",
"analyse_region_noage", "mage region curse",
mage, r, LOC(lang, mkname("spell", c->type->cname))));
} else {
ADDMSG(&mage->faction->msgs, msg_message(
"analyse_region_age", "mage region spell months",
"analyse_region_age", "mage region curse months",
mage, r, LOC(lang, mkname("spell", c->type->cname)), mon));
}
} else {
@ -236,11 +236,11 @@ magicanalyse_unit(unit *u, unit *mage, double force)
if (chance(probability)) { /* Analyse geglückt */
if(c->flag & CURSE_NOAGE){
ADDMSG(&mage->faction->msgs, msg_message(
"analyse_unit_noage", "mage unit spell",
"analyse_unit_noage", "mage unit curse",
mage, u, LOC(lang, mkname("spell", c->type->cname))));
}else{
ADDMSG(&mage->faction->msgs, msg_message(
"analyse_unit_age", "mage unit spell months",
"analyse_unit_age", "mage unit curse months",
mage, u, LOC(lang, mkname("spell", c->type->cname)), mon));
}
} else {
@ -278,11 +278,11 @@ magicanalyse_building(building *b, unit *mage, double force)
if (chance(probability)) { /* Analyse geglückt */
if(c->flag & CURSE_NOAGE){
ADDMSG(&mage->faction->msgs, msg_message(
"analyse_building_age", "mage building spell",
"analyse_building_age", "mage building curse",
mage, b, LOC(lang, mkname("spell", c->type->cname))));
}else{
ADDMSG(&mage->faction->msgs, msg_message(
"analyse_building_age", "mage building spell months",
"analyse_building_age", "mage building curse months",
mage, b, LOC(lang, mkname("spell", c->type->cname)), mon));
}
} else {
@ -320,11 +320,11 @@ magicanalyse_ship(ship *sh, unit *mage, double force)
if (chance(probability)) { /* Analyse geglückt */
if(c->flag & CURSE_NOAGE){
ADDMSG(&mage->faction->msgs, msg_message(
"analyse_ship_noage", "mage ship spell",
"analyse_ship_noage", "mage ship curse",
mage, sh, LOC(lang, mkname("spell", c->type->cname))));
}else{
ADDMSG(&mage->faction->msgs, msg_message(
"analyse_ship_age", "mage ship spell months",
"analyse_ship_age", "mage ship curse months",
mage, sh, LOC(lang, mkname("spell", c->type->cname)), mon));
}
} else {
@ -8534,7 +8534,7 @@ static spell spelldaten[] =
},
{
SPL_DRAIG_DESTROY_MAGIC, "draigdestroymagic", NULL,
"ZAUBERE [REGION x y] [STUFE n] \'Pentagramm\' REGIONn"
"ZAUBERE [REGION x y] [STUFE n] \'Pentagramm\' REGION\n"
"ZAUBERE [REGION x y] [STUFE n] \'Pentagramm\' EINHEIT <Einheit-Nr>\n"
"ZAUBERE [REGION x y] [STUFE n] \'Pentagramm\' GEBÄUDE <Gebäude-Nr>\n"
"ZAUBERE [REGION x y] [STUFE n] \'Pentagramm\' SCHIFF <Schiff-Nr>",

View File

@ -1025,7 +1025,7 @@
<type>
<arg name="mage" type="unit"/>
<arg name="ship" type="ship"/>
<arg name="spell" type="string"/>
<arg name="curse" type="string"/>
<arg name="months" type="int"/>
</type>
<text locale="de">"$unit($mage) fand heraus, dass auf $ship($ship) der Zauber $spell liegt, der noch etwa $int($months) Wochen bestehen bleibt."</text>
@ -1036,7 +1036,7 @@
<type>
<arg name="mage" type="unit"/>
<arg name="building" type="building"/>
<arg name="spell" type="string"/>
<arg name="curse" type="string"/>
<arg name="months" type="int"/>
</type>
<text locale="de">"$unit($mage) fand heraus, dass auf $building($building) der Zauber $spell liegt, der noch etwa $int($months) Wochen bestehen bleibt."</text>
@ -1047,7 +1047,7 @@
<type>
<arg name="mage" type="unit"/>
<arg name="unit" type="unit"/>
<arg name="spell" type="string"/>
<arg name="curse" type="string"/>
<arg name="months" type="int"/>
</type>
<text locale="de">"$unit($mage) fand heraus, dass auf $unit($unit) der Zauber $spell liegt, der noch etwa $int($months) Wochen bestehen bleibt."</text>
@ -1058,7 +1058,7 @@
<type>
<arg name="mage" type="unit"/>
<arg name="region" type="region"/>
<arg name="spell" type="string"/>
<arg name="curse" type="string"/>
<arg name="months" type="int"/>
</type>
<text locale="de">"$unit($mage) fand heraus, dass auf $region($region) der Zauber $spell liegt, der noch etwa $int($months) Wochen bestehen bleibt."</text>
@ -1069,7 +1069,7 @@
<type>
<arg name="mage" type="unit"/>
<arg name="ship" type="ship"/>
<arg name="spell" type="string"/>
<arg name="curse" type="string"/>
</type>
<text locale="de">"$unit($mage) fand heraus, dass auf $ship($ship) der Zauber $spell liegt, dessen Kraft ausreicht, um noch Jahrhunderte bestehen zu bleiben."</text>
<text locale="fr">"$unit($mage) discovers that $ship($ship) is charmed with $spell, which will last for centuries."</text>
@ -1079,7 +1079,7 @@
<type>
<arg name="mage" type="unit"/>
<arg name="building" type="building"/>
<arg name="spell" type="string"/>
<arg name="curse" type="string"/>
</type>
<text locale="de">"$unit($mage) fand heraus, dass auf $building($building) der Zauber $spell liegt, dessen Kraft ausreicht, um noch Jahrhunderte bestehen zu bleiben."</text>
<text locale="fr">"$unit($mage) discovers that $building($building) is charmed with $spell, which will last for centuries."</text>
@ -1089,7 +1089,7 @@
<type>
<arg name="mage" type="unit"/>
<arg name="unit" type="unit"/>
<arg name="spell" type="string"/>
<arg name="curse" type="string"/>
</type>
<text locale="de">"$unit($mage) fand heraus, dass auf $unit($unit) der Zauber $spell liegt, dessen Kraft ausreicht, um noch Jahrhunderte bestehen zu bleiben."</text>
<text locale="fr">"$unit($mage) discovers that $unit($unit) is charmed with $spell, which will last for centuries."</text>
@ -1099,7 +1099,7 @@
<type>
<arg name="mage" type="unit"/>
<arg name="region" type="region"/>
<arg name="spell" type="string"/>
<arg name="curse" type="string"/>
</type>
<text locale="de">"$unit($mage) fand heraus, dass auf $region($region) der Zauber $spell liegt, dessen Kraft ausreicht, um noch Jahrhunderte bestehen zu bleiben."</text>
<text locale="fr">"$unit($mage) discovers that $region($region) is charmed with $spell, which will last for centuries."</text>
@ -1274,8 +1274,8 @@
<arg name="region" type="region"/>
<arg name="spell" type="spell"/>
</type>
<text locale="de">"$unit($unit) unterläuft in $region($region) beim Zaubern von $spell ein Patzer:"</text>
<text locale="en">"$unit($unit) fumbles while casting $spell in $region($region):"</text>
<text locale="de">"$unit($unit) unterläuft in $region($region) beim Zaubern von $spell($spell) ein Patzer:"</text>
<text locale="en">"$unit($unit) fumbles while casting $spell($spell) in $region($region):"</text>
</message>
<message name="patzer3" section="magic">
<type>