forked from github/server
Fixed a null-pointer crash in randenc.
Dead code in economy removed.
This commit is contained in:
parent
e240860486
commit
dd9c6e50c2
|
@ -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);
|
||||
add_message(&r->msgs, msg);
|
||||
for (u=r->units; u; u=u->next) {
|
||||
|
|
|
@ -455,19 +455,21 @@ get_allies(region * r, unit * u)
|
|||
break;
|
||||
}
|
||||
|
||||
u_setfaction(newunit, u->faction);
|
||||
set_racename(&newunit->attribs, get_racename(u->attribs));
|
||||
if(u->race->flags & RCF_SHAPESHIFT) {
|
||||
newunit->irace = u->irace;
|
||||
}
|
||||
if (fval(u, UFL_PARTEITARNUNG)) fset(newunit, UFL_PARTEITARNUNG);
|
||||
fset(newunit, UFL_ISNEW);
|
||||
if (newunit!=NULL) {
|
||||
u_setfaction(newunit, u->faction);
|
||||
set_racename(&newunit->attribs, get_racename(u->attribs));
|
||||
if(u->race->flags & RCF_SHAPESHIFT) {
|
||||
newunit->irace = u->irace;
|
||||
}
|
||||
if (fval(u, UFL_PARTEITARNUNG)) fset(newunit, UFL_PARTEITARNUNG);
|
||||
fset(newunit, UFL_ISNEW);
|
||||
|
||||
sprintf(buf, "Plötzlich stolper%c %s über einige %s. Nach kurzem "
|
||||
"Zögern entschließen sich die %s, sich Deiner Partei anzuschließen.",
|
||||
u->number == 1 ? 't' : 'n', unitname(u), newunit->name, newunit->name);
|
||||
sprintf(buf, "Plötzlich stolper%c %s über einige %s. Nach kurzem "
|
||||
"Zögern entschließen sich die %s, sich Deiner Partei anzuschließen.",
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue