Page 1 of 1

Attack/defense bug with merc limit

Posted: Tue Mar 27, 2007 2:20 am
by Nostradamus
You have 10k mercs with weapons and because you are over your limit 1% of them are deserting each turn. The function that desert them is placed after the function that calculates the stats, so you keep the same stats even when all of them have deserted.

I noticed this while on PPT and I belive that after 1 attack by you or on you the stats will be recalculated, still this can be exploited to hit someone big 1 time without losing troops at all.

Posted: Tue Mar 27, 2007 5:13 am
by Mattwell
They desert on the turn, so you could hit a bunch of times before losing any, as long as the turn hasn't gone yet.

Posted: Tue Mar 27, 2007 8:30 am
by Nostradamus
You don't get it.

Each attack after your losses are calculated your attack/defense is recalculated. This is a distinct php function.

Every turn how many mercs are deserting it's also calculated. This is another distinct php function.

The problem is that after you lose mercs the desertion function doesn't call the stats calculating function and you stay with the same stats and this can be exploited, but only 1 time because after an attack the stats calculating function is called and it will notice that some mercs are gone.