Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2005:
[Freeciv-Dev] (PR#13178) Major bug allows cheating with techpenalty=0
Home

[Freeciv-Dev] (PR#13178) Major bug allows cheating with techpenalty=0

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: lists@xxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#13178) Major bug allows cheating with techpenalty=0
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 26 May 2005 08:43:23 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13178 >

Problem is we're using the research code in a way it wasn't originally
intended for.  Originally you would only get new techs at the end of the
turn.  Per changed it (I'm not sure why) so you get new techs
immediately when changing targets.  This means you sometimes can't
switch tech target and switch back without penalty.  Resetting
changed_from when a new tech is researched seems like the safest and
best solution.  You shouldn't be penalized when switching back to your
original tech because got_tech has been set.  However it does mean all
your bulbs are penalized instead of only the ones you switched with.

With a 2000-bulb tech "A" and a 500-bulb tech "B" and a 50% techpenalty:

1.  Start with 1900 bulbs on tech A.
2.  Switch to tech B: you're penalized down to 950 bulbs.
3.  You get tech B.  Now you're down to 450 bulbs.
4.  You switch back to tech A.  No penalty - 450 bulbs.

What I'd say "should" happen is:

1.  Start with 1900 bulbs on tech A.
2.  Switch to tech B: you're penalized down to 950 bulbs.
3.  You get tech B.  Now you have 450 bulbs.
4.  You switch back to tech A.  The previous penalty is dropped so you
have 900 bulbs.

The second could be accomplished by leaving changed_from as it is and
reducing bulbs_researched_before by some amount.  But I don't know that
it's worth it.

-jason




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