[Freeciv-Dev] [Fwd: Re: Re: (PR#18293) Missing building tag crashes scie
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=18293 >
Marko Lindqvist wrote:
> On 7/9/06, Marko Lindqvist <cazfi74@xxxxxxxxx> wrote:
>>
>> You should be able to avoid crash by adding missing b.amusement_park
>> tag in to buildings.spec.
>>
>> Of course missing tag should not cause silent crash.
>
> Client should print message about missing tag in startup and science
> dialog should work without buildings graphics.
There already is LOG_VERBOSE message about missing building tags while
tileset is loaded. Attached patch takes care of the crash.
- ML
diff -Nurd -X.diff_ignore freeciv/client/reqtree.c freeciv/client/reqtree.c
--- freeciv/client/reqtree.c 2006-07-20 21:39:36.640625000 +0300
+++ freeciv/client/reqtree.c 2006-07-20 22:38:31.015625000 +0300
@@ -179,9 +179,12 @@
if (preq->source.type == REQ_TECH
&& preq->source.value.tech == node->tech) {
sprite = get_building_sprite(tileset, impr_type);
- get_sprite_dimensions(sprite, &swidth, &sheight);
- max_icon_height = MAX(max_icon_height, sheight);
- icons_width_sum += swidth + 2;
+ /* Improvement icons are not guaranteed to exist */
+ if (sprite) {
+ get_sprite_dimensions(sprite, &swidth, &sheight);
+ max_icon_height = MAX(max_icon_height, sheight);
+ icons_width_sum += swidth + 2;
+ }
}
} requirement_vector_iterate_end;
} impr_type_iterate_end;
@@ -950,13 +953,16 @@
if (preq->source.type == REQ_TECH
&& preq->source.value.tech == node->tech) {
sprite = get_building_sprite(tileset, impr_type);
- get_sprite_dimensions(sprite, &swidth, &sheight);
- canvas_put_sprite_full(pcanvas,
- icon_startx,
- starty + text_h + 4
- + (height - text_h - 4 - sheight) / 2,
- sprite);
- icon_startx += swidth + 2;
+ /* Improvement icons are not guaranteed to exist */
+ if (sprite) {
+ get_sprite_dimensions(sprite, &swidth, &sheight);
+ canvas_put_sprite_full(pcanvas,
+ icon_startx,
+ starty + text_h + 4
+ + (height - text_h - 4 - sheight) / 2,
+ sprite);
+ icon_startx += swidth + 2;
+ }
}
} requirement_vector_iterate_end;
} impr_type_iterate_end;
- [Freeciv-Dev] Re: (PR#18293) Freeciv crash, Per I. Mathisen, 2006/07/05
- [Freeciv-Dev] Re: (PR#18293) Freeciv crash, Ricky, 2006/07/06
- [Freeciv-Dev] Re: (PR#18293) Freeciv crash, Ricky, 2006/07/06
- [Freeciv-Dev] Re: (PR#18293) Freeciv crash, Marko Lindqvist, 2006/07/08
- [Freeciv-Dev] Re: (PR#18293) Freeciv crash, Ricky, 2006/07/11
- [Freeciv-Dev] Re: (PR#18293) Freeciv crash, Marko Lindqvist, 2006/07/09
- [Freeciv-Dev] Re: (PR#18293) Freeciv crash, Ricky, 2006/07/11
- [Freeciv-Dev] Re: (PR#18293) Freeciv crash, Marko Lindqvist, 2006/07/09
- [Freeciv-Dev] [Fwd: Re: Re: (PR#18293) Missing building tag crashes science dialog],
Marko Lindqvist <=
- [Freeciv-Dev] Re: [Fwd: Re: Re: (PR#18293) Missing building tag crashes science dialog], Ricky, 2006/07/21
|
|