Fixed a null-pointer crash in randenc.

Dead code in economy removed.
This commit is contained in:
Enno Rehling 2005-10-02 07:33:21 +00:00
parent e240860486
commit dd9c6e50c2
2 changed files with 13 additions and 20 deletions

View file

@ -1001,15 +1001,6 @@ gebaeude_stuerzt_ein(region * r, building * b)
} }
} }
/* Falls Karawanserei, Damm oder Tunnel einstürzen, wird die schon
* gebaute Straße zur Hälfte vernichtet */
if (b->type == bt_find("caravan") || b->type == bt_find("dam") || b->type == bt_find("tunnel")) {
for (d=0;d!=MAXDIRECTIONS;++d) if (rroad(r, d) > 0) {
road = 1;
/* vernichtung findet erst in destroy_building statt! */
break;
}
}
msg = msg_message("buildingcrash", "region building opfer road", r, b, opfer, road); msg = msg_message("buildingcrash", "region building opfer road", r, b, opfer, road);
add_message(&r->msgs, msg); add_message(&r->msgs, msg);
for (u=r->units; u; u=u->next) { for (u=r->units; u; u=u->next) {

View file

@ -455,6 +455,7 @@ get_allies(region * r, unit * u)
break; break;
} }
if (newunit!=NULL) {
u_setfaction(newunit, u->faction); u_setfaction(newunit, u->faction);
set_racename(&newunit->attribs, get_racename(u->attribs)); set_racename(&newunit->attribs, get_racename(u->attribs));
if(u->race->flags & RCF_SHAPESHIFT) { if(u->race->flags & RCF_SHAPESHIFT) {
@ -468,6 +469,7 @@ get_allies(region * r, unit * u)
u->number == 1 ? 't' : 'n', unitname(u), newunit->name, newunit->name); u->number == 1 ? 't' : 'n', unitname(u), newunit->name, newunit->name);
addmessage(r, u->faction, buf, MSG_EVENT, ML_IMPORTANT); addmessage(r, u->faction, buf, MSG_EVENT, ML_IMPORTANT);
}
} }
static void static void