Re: [Freeciv-Dev] (PR#39715) Crash when discovering a Future Tech

2007-09-24 Thread William Allen Simpson

URL: http://bugs.freeciv.org/Ticket/Display.html?id=39715 

Also reported by [EMAIL PROTECTED] on freeciv-dev list with savegame
and proposed patch:

Re: [Freeciv-Dev] Segfault bug in advance_has_flag in common/tech.c

Committed trunk revision 13640.

Index: server/techtools.c
===
--- server/techtools.c  (revision 13638)
+++ server/techtools.c  (working copy)
@@ -203,7 +203,8 @@
   remove_obsolete_buildings(plr);
   
   /* Give free rails in every city */
-  if (advance_has_flag(tech_found, TF_RAILROAD)) {
+  if (tech_found != A_FUTURE
+advance_has_flag(tech_found, TF_RAILROAD)) {
 upgrade_city_rails(plr, was_discovery);  
   }
   
@@ -303,7 +304,8 @@
 } improvement_iterate_end;
   }
 
-  if (advance_has_flag(tech_found, TF_BONUS_TECH)  was_first) {
+  if (was_first  tech_found != A_FUTURE
+advance_has_flag(tech_found, TF_BONUS_TECH)) {
 bonus_tech_hack = TRUE;
   }
   
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#39715) Crash when discovering a Future Tech

2007-09-20 Thread William Allen Simpson

URL: http://bugs.freeciv.org/Ticket/Display.html?id=39715 

That's correct.  This is related to the debugging in PR#39714.

The flags aren't valid for A_FUTURE (or A_UNKNOWN or A_UNUSED), and these
should never be set to TECH_KNOWN.  Where is that happening?

Please send traceback!  And savegame just before event happens!



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#39715) Crash when discovering a Future Tech

2007-09-18 Thread Petr Baudis

URL: http://bugs.freeciv.org/Ticket/Display.html?id=39715 

advance_has_flag() can be called with A_FUTURE, however for that tech
advance_by_number() will return NULL and the civserver will crash.



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev