OK sorry, didn't realize that you were using segfaults
for that purpose.

I'm attaching a different diff.  This one prevents
advance_has_flag from being called on future techs, in
two locations.  advance_has_flag(A_FUTURE) results in
a segfault.

in both cases, the call should not be needed, as they
are checks to see if A_FUTURE has the effects
TF_BONUS_TECH and TF_RAILROAD.  A_FUTURE should never
have these affects.

Thanks,

Brian Dunstan


--- William Allen Simpson
<[EMAIL PROTECTED]> wrote:

> Brian Dunstan wrote:
> > This soon produced a segfault which I traced to
> > advance_has_flag() in common/tech.c
> > 
> Thanks for the savegame.  Your proposed patch should
> not be applied, as
> the whole point of the function is to find bad
> indices, and use the
> segfault to locate the bad call!
> 
> The proper patch will fix the bad call, instead.
> 
> _______________________________________________
> Freeciv-dev mailing list
> Freeciv-dev@gna.org
> https://mail.gna.org/listinfo/freeciv-dev
> 


       
____________________________________________________________________________________
Be a better Heartthrob. Get better relationship answers from someone who knows. 
Yahoo! Answers - Check it out. 
http://answers.yahoo.com/dir/?link=list&sid=396545433
diff -Nur freeciv-original/server/techtools.c freeciv/server/techtools.c
--- freeciv-original/server/techtools.c	2007-09-22 10:37:34.000000000 -0400
+++ freeciv/server/techtools.c	2007-09-22 12:36:19.000000000 -0400
@@ -203,7 +203,7 @@
   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 +303,7 @@
     } improvement_iterate_end;
   }
 
-  if (advance_has_flag(tech_found, TF_BONUS_TECH) && was_first) {
+  if ((tech_found != A_FUTURE) && advance_has_flag(tech_found, TF_BONUS_TECH) && was_first) {
     bonus_tech_hack = TRUE;
   }
   
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to