<URL: http://bugs.freeciv.org/Ticket/Display.html?id=39354 >
This transaction appears to have no content
Here is the fix in a patch file format, with comments to explain some of the
weirder aspects of the fix. This is fixed on the 2.1 branch taken from the
SVN current as of 3:30 a.m. mdt (9:30 a.m. GMT I believe) on 4/25/07.
Here is the fix in a patch file format, with comments to explain some of the weirder aspects of the fix. This is fixed on the 2.1 branch taken from the SVN current as of 3:30 a.m. mdt (9:30 a.m. GMT I believe) on 4/25/07.
--- tech.old 2007-04-25 03:43:41.000000000 -0600
+++ tech.c 2007-04-25 03:48:05.000000000 -0600
@@ -200,10 +200,33 @@
**************************************************************************/
bool tech_is_available(const struct player *pplayer, Tech_type_id id)
{
+ int i;
+
if (!tech_exists(id)) {
return FALSE;
}
+ /* Modification to allow techs with root_req set to themselves to be
+ * assigned to a nation that has it set in init_techs. Note that
+ * the client makes this check without providing a player pointer
+ * thus we need to return a TRUE in that case. */
+ if (advances[id].root_req == id) {
+ if (pplayer && pplayer->nation) {
+ for (i = 0; i < MAX_NUM_TECH_LIST; i++) {
+ if (pplayer->nation->init_techs[i] == A_LAST) {
+ break;
+ }
+ if (pplayer->nation->init_techs[i] == id) {
+ return TRUE;
+ }
+ }
+ return FALSE;
+ } else {
+ return TRUE;
+ }
+ }
+
+
if (advances[id].root_req != A_NONE
&& get_invention(pplayer, advances[id].root_req) != TECH_KNOWN) {
/* This tech requires knowledge of another tech before being
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev