[Freeciv-Dev] (PR#13772) CVS: civserver get_invention assert
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13772 >
> [yautja@xxxxxxxxxxxxxxx - Thu Aug 25 07:17:34 2005]:
>
> > civserver: tech.c:60: get_invention: Assertion `tech == (200-2) ||
> (tech >= 0 && tech < game.control.num_tech_types)' failed.
> Abort
>
> Happens in the savegame if you turndone / timeout. Only things that stop
> it is giving a new research goal or changing the science rate.
>
>
Evaluation for Great Library:
case EFT_TECH_PARASITE:
v += (total_bulbs_required(pplayer) * (100 - game.info.freecost)
* (nplayers - amount)) / (nplayers * amount * 100);
break;
The bug is that total_bulbs_required can't be called for A_UNSET.
This evaluation is also strange it strongly depends on current research
progress. I propose the attached evaluation, which seems to be little
more reasonable.
--
mateusz
Index: ai/aicity.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/aicity.c,v
retrieving revision 1.238
diff -u -r1.238 aicity.c
--- ai/aicity.c 22 Aug 2005 21:15:49 -0000 1.238
+++ ai/aicity.c 25 Aug 2005 09:38:05 -0000
@@ -406,8 +406,11 @@
}
break;
case EFT_TECH_PARASITE:
- v += (total_bulbs_required(pplayer) * (100 - game.info.freecost)
- * (nplayers - amount)) / (nplayers * amount * 100);
+ /* If we build GL, we can spend our bulbs on taxes */
+ v += (pplayer->bulbs_last_turn + 20) * 25
+ * (100 - game.info.freecost)
+ * (nplayers - amount)
+ / (nplayers * amount * 100);
break;
case EFT_GROWTH_FOOD:
v += c * 4 + (amount / 7) * pcity->surplus[O_FOOD];
|
|