forked from github/server
Bufix null-pointers in regionname
This commit is contained in:
parent
1b84f9d61f
commit
f9657cf936
|
@ -161,7 +161,7 @@ int
|
|||
region_x(const region *r, const faction *f)
|
||||
{
|
||||
plane *pl;
|
||||
|
||||
assert(r!=NULL);
|
||||
pl = getplane(r);
|
||||
return r->x - ursprung_x(f, pl, r) - plane_center_x(pl);
|
||||
}
|
||||
|
@ -170,7 +170,7 @@ int
|
|||
region_y(const region *r, const faction *f)
|
||||
{
|
||||
plane *pl;
|
||||
|
||||
assert(r!=NULL);
|
||||
pl = getplane(r);
|
||||
return r->y - plane_center_y(pl) - ursprung_y(f, pl, r);
|
||||
}
|
||||
|
@ -179,7 +179,7 @@ void
|
|||
set_ursprung(faction *f, int id, int x, int y)
|
||||
{
|
||||
ursprung *ur;
|
||||
|
||||
assert(f!=NULL);
|
||||
for(ur=f->ursprung;ur;ur=ur->next) {
|
||||
if(ur->id == id) {
|
||||
ur->x += x;
|
||||
|
|
|
@ -75,8 +75,9 @@ regionname(const region * r, const faction * f)
|
|||
{
|
||||
static char buf[65];
|
||||
plane *pl = getplane(r);
|
||||
|
||||
if (f == NULL) {
|
||||
if (r==NULL) {
|
||||
strcpy(buf, "(null)");
|
||||
} else if (f == NULL) {
|
||||
strncpy(buf, rname(r, NULL), 65);
|
||||
} else if (pl && fval(pl, PFL_NOCOORDS)) {
|
||||
strncpy(buf, rname(r, f->locale), 65);
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
<arg name="number" type="int"></arg>
|
||||
<arg name="race" type="race"></arg>
|
||||
</type>
|
||||
<text locale="de">"$if($isnull($region),"In $region($region)","Es") wurde$if($eq($number,1),"","n") $number $race($race,$number) gesichtet."</text>
|
||||
<text locale="en">"In $region($region), $number $race($race,$number) were discovered."</text>
|
||||
<text locale="de">"$if($isnull($region),"Es","In $region($region)") wurde$if($eq($number,1),"","n") $number $race($race,$number) gesichtet."</text>
|
||||
<text locale="en">$if($isnull($region),"","In $region($region), ")$number $race($race,$number) were discovered."</text>
|
||||
</message>
|
||||
<message name="mallorn_effect" section="magic">
|
||||
<type>
|
||||
|
|
Loading…
Reference in New Issue