Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2004:
[Freeciv-Dev] (PR#10965) great library vs. freecost
Home

[Freeciv-Dev] (PR#10965) great library vs. freecost

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: chrisk@xxxxxxxxx
Subject: [Freeciv-Dev] (PR#10965) great library vs. freecost
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 13 Nov 2004 01:39:51 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=10965 >

> [chrisk - Wed Nov 10 16:55:36 2004]:
> 
> 
> CVS 10 NOV 2004 S2 GTK2
> 
> When I get a tech from library, my current bulbs are lost. My options
> are:
> 
> /show: techpenalty    =100   (0,100)        Abzug (%) bei
> Forschungsänderung
> /show: diplcost       =0     (0,100)        Abzug für
> Forschungsergebnisse aus Abkommen
> /show: conquercost    =0     (0,100)        Abzug für erbeutete
> Forschungsergebnisse
> /show: freecost       =0     (0,100)        Abzug für 'kostenlose'
> Entwicklungen
> 
> I think freecost is relevant here.

Indeed, it should be.  When a tech is gained from the great library
do_free_cost is called:

/**************************************************************************
...
**************************************************************************/
void do_free_cost(struct player *pplayer)
{
  pplayer->research.bulbs_researched -=
      (total_bulbs_required(pplayer) * game.freecost) / 100;
}

which looks like it works correctly.

However there's also this code in found_new_tech:

  if (!saving_bulbs && plr->research.bulbs_researched > 0) {
    plr->research.bulbs_researched = 0;
  }

which looks like (since saving_bulbs is FALSE in this case) it will
always cost you all your research.

This patch changes it.  But I haven't tested it.  It should also be
tested to make sure it works with freecost.

jason

Index: server/plrhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/plrhand.c,v
retrieving revision 1.337
diff -u -r1.337 plrhand.c
--- server/plrhand.c    10 Nov 2004 06:09:26 -0000      1.337
+++ server/plrhand.c    13 Nov 2004 09:39:06 -0000
@@ -150,7 +150,7 @@
            advances[i].name);
 
        do_free_cost(pplayer);
-       found_new_tech(pplayer, i, FALSE, FALSE, A_NONE);
+       found_new_tech(pplayer, i, FALSE, TRUE, A_NONE);
        break;
       }
     } tech_type_iterate_end;

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