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]
Subject: [Freeciv-Dev] (PR#13178) Major bug allows cheating with techpenalty=0
From: "Thomas Müller" <lists@xxxxxxxxxxx>
Date: Thu, 26 May 2005 03:40:26 -0700
Reply-to: bugs@xxxxxxxxxxx

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

Ok, since i had problems with a cheater yesterday (yes mrvn, thats you :) i 
tried to pinpoint the method of cheating (the bulbnumbers are wrong, doesnt 
matter)

1. Set Techpenalty 0
2. Set Techgoal to something, research something
3. Set Tech to Navigation (500 points), techgoal stays at nothing.
4. Nearly Research Navigation so you have 400/500 bulbs
5. Switch Tech to horsebackriding (50 bulbs)
6. You have 350 Bulbs now, and get horseback riding
7. Switch back to Navigation
8. Code thinks: Ah, newbie klicking around, we dont want them to pay 
techpenalty, give them theire old bulbs.. .and you have 400 Bulbs again.

You can research for free, and totaly exploit the bugs. 

WORKAROUND: Never set techpenalty to 0, always 100, then you're save.

Patch: I cant code, but this bug was so obvious to find, i think i resolved 
it. But i cant use diff either, so i have to tell you, what to do :)

Bug is in Line 631 in /server/plrhand.c
The condition to give Bulbs back is:
 } else if (tech == plr->research.changed_from) {

But it should be:
} else if (tech == plr->research.changed_from && !plr->got_tech) {

I compiled, the bug is gone, and it seems everything is working ok. There is 
one small drawback for noobs. 
With techpenalty i.e 80 and the above scenario, when you click on riding you 
seem to loose 400*80%=320 points, research riding, and have 30 bulbs left.
But hey, they have to learn it sooner or later, and this doenst happen with 
default techpenalty 100.


Right now i feel stupid, should have checked cvs first... but i hope, that a 
bug as big as this, gets fixed and might even be released as 2.0.2, since it 
makes playing with techpenalty=0 totaly impossible. And pls, fix the 
pubservers :)

And thx to the cheater that abused this bug so much, that i stumbled across 
it: mrvn

P.S.: Do i get an entry in changelog as elfstone? That would be nice :)




-- 
Rhabarberkuchen schmeckt viel besser, wenn
man statt Rhabarber Erdbeeren nimmt.





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