View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
---|---|---|---|---|---|---|---|---|---|
0001123 | Spring engine | General | public | 2008-10-12 19:25 | 2008-10-13 12:43 | ||||
Reporter | el_matarife | ||||||||
Assigned To | Kloot | ||||||||
Priority | normal | Severity | block | Reproducibility | always | ||||
Status | resolved | Resolution | fixed | ||||||
Product Version | 0.77b3 | ||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0001123: Player bonus / handicap exploit | ||||||||
Description | Handicap applies to ALL incoming metal / energy including reclaim, so you can build units / structures and reclaim for more than you spent, leading to an infinite economy exploit. Attached is a replay proving it. | ||||||||
Tags | No tags attached. | ||||||||
Checked infolog.txt for Errors | |||||||||
Attached Files |
|
![]() |
|
el_matarife (reporter) 2008-10-12 20:06 |
Lurker wrote a fix, and hooked me up with the diff since he couldn't attach it to this or upload it to SVN. |
imbaczek (reporter) 2008-10-12 21:44 |
committed in r6686, please test and report if it's fixed. |
Kloot (developer) 2008-10-12 22:04 Last edited: 2008-10-12 22:18 |
On a general note, this ... if (handicap) { amount *= handicap; } ... is not a very useful expression since handicap is a bool, ie. if it is true then <amount> is just multiplied by 1 (no-op) and if it is false then <amount> is left untouched. That means the patch won't work. float f(float amount, bool arg) { if (arg) { amount *= arg; } return amount; } int main(void) { printf("%f\n", f(5.0f, 0)); // 5.0 printf("%f\n", f(5.0f, 1)); // 5.0 printf("%f\n", f(5.0f, 2)); // 5.0 printf("%f\n", f(5.0f, 3)); // 5.0 return 0; } Also, the patch breaks handicap itself (a value of 100 which should double your commander's metal income gives only the default amount). |
imbaczek (reporter) 2008-10-12 22:06 |
i admit i didn't do a thorough review, and lurker can't even see this mantis issue since it's marked private, so he won't see any comments ^_^ |
imbaczek (reporter) 2008-10-12 22:32 |
aye i'm not thinking too well today, only just understood what you were talking about... will fix asap. |
el_matarife (reporter) 2008-10-12 22:44 |
Well, I've been thinking about it and I guess we can open this up. It's easy enough to work around this for now, and since we know it will be fixed soon there's no reason to keep it private. |
imbaczek (reporter) 2008-10-12 22:52 |
fixed the fix. also opening up to public disclosure at reporter's request. |
lurker (reporter) 2008-10-13 02:47 |
I told matarife I hadn't been able to test it, I guess he neglected to put that in the mantis comment.. |
Kloot (developer) 2008-10-13 12:43 |
fixed now |
![]() |
|||
Date Modified | Username | Field | Change |
---|---|---|---|
2008-10-12 19:25 | el_matarife | New Issue | |
2008-10-12 19:26 | el_matarife | File Added: 20081012_121814_SpeedMetal_0.77b3.sdf | |
2008-10-12 20:05 | el_matarife | File Added: handicapreclaim.diff | |
2008-10-12 20:06 | el_matarife | Note Added: 0002823 | |
2008-10-12 21:44 | imbaczek | Note Added: 0002825 | |
2008-10-12 21:50 | Kloot | Status | new => confirmed |
2008-10-12 22:04 | Kloot | Note Added: 0002827 | |
2008-10-12 22:06 | Kloot | Note Edited: 0002827 | |
2008-10-12 22:06 | imbaczek | Note Added: 0002828 | |
2008-10-12 22:18 | Kloot | Note Edited: 0002827 | |
2008-10-12 22:32 | imbaczek | Note Added: 0002829 | |
2008-10-12 22:44 | el_matarife | Note Added: 0002830 | |
2008-10-12 22:52 | imbaczek | Note Added: 0002831 | |
2008-10-12 22:52 | imbaczek | View Status | private => public |
2008-10-13 02:47 | lurker | Note Added: 0002832 | |
2008-10-13 12:43 | Kloot | Status | confirmed => resolved |
2008-10-13 12:43 | Kloot | Resolution | open => fixed |
2008-10-13 12:43 | Kloot | Assigned To | => Kloot |
2008-10-13 12:43 | Kloot | Note Added: 0002839 |