Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2003:
[Freeciv-Dev] Re: (PR#4629) Missing graphics tags shouldn't generate mes
Home

[Freeciv-Dev] Re: (PR#4629) Missing graphics tags shouldn't generate mes

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#4629) Missing graphics tags shouldn't generate messages?
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 22 Jul 2003 21:35:02 -0700
Reply-to: rt@xxxxxxxxxxxxxx

Jason Short wrote:

> I think I agree.  Either the sprite is optional, in which case it 
> shouldn't generate a warning message...or it isn't, in which case the 
> client should generate a real message and fail to load the tileset.

And a better patch - this one makes improvement graphics optional.

jason

Index: client/tilespec.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/tilespec.c,v
retrieving revision 1.123
diff -u -r1.123 tilespec.c
--- client/tilespec.c   2003/07/21 01:43:51     1.123
+++ client/tilespec.c   2003/07/23 04:33:35
@@ -1033,7 +1033,6 @@
                                            const char *name)
 {
   struct Sprite *sp;
-  int loglevel = required ? LOG_NORMAL : LOG_DEBUG;
   
   /* (should get sprite_hash before connection) */
   if (!sprite_hash) {
@@ -1045,13 +1044,18 @@
 
   sp = load_sprite(alt);
   if (sp) {
-    freelog(loglevel, "Using alternate graphic %s (instead of %s) for %s %s",
+    freelog(LOG_VERBOSE,
+           "Using alternate graphic %s (instead of %s) for %s %s",
            alt, tag, what, name);
     return sp;
   }
-  
-  freelog(loglevel, "Don't have graphics tags %s or %s for %s %s",
+
+  freelog(required ? LOG_FATAL : LOG_VERBOSE,
+         _("Don't have graphics tags %s or %s for %s %s"),
          tag, alt, what, name);
+  if (required) {
+    exit(EXIT_FAILURE);
+  }
   return NULL;
 }
 
@@ -1080,7 +1084,7 @@
 
   pimpr->sprite = lookup_sprite_tag_alt(pimpr->graphic_str,
                                        pimpr->graphic_alt,
-                                       improvement_exists(id), "impr_type",
+                                       FALSE, "impr_type",
                                        pimpr->name);
 
   /* should maybe do something if NULL, eg generic default? */

[Prev in Thread] Current Thread [Next in Thread]