Subject: [MM] MMs M.A.X 1.33
Hi all.
Necessary to place limits in these codes of upgrade.
Not to exist one radar of 100 of vision (the max is 40 in real M.A.X) and nor one missile of 60 of vision ( the max is 24 in real M.A.X), therefore with this code is infinite, and wants to impose limits, [ in 11 case (org==11) ] is range it (distance) (red line in atack) and the initial price is of 8…
so that it has the initial value more does not exist end!
// Berechnet den Preis für ein Upgrade aus:
int CalcPrice(int value,int org){
int tmp,t;
if(org==1)tmp=720;
else if(org==2)tmp=79;
else if(org==3)tmp=61;
else if(org==4)tmp=54;
else if(org==5)tmp=48;
else if(org==6)tmp=35;
else if(org==7)tmp=31;
else if(org==8)tmp=27;
else if(org==9)tmp=23;
else if(org==10)tmp=18;
else if(org==11)tmp=8;
else if(org==12)tmp=8;
else if(org==13)tmp=7;
else if(org>=14&&org<=20)tmp=5;
else if(org>=21&&org<=26)tmp=3;
else if(org>=27&&org<=32)tmp=2;
else if(org>=33)tmp=1;
while(org<value){
t=org*0.2;
if(t==0)t++;
org+=t;
tmp*=2;
}
return tmp;
}
//end of parcial code
please help to impose limits
Thanks
ThiagoLG
Thiago Medeiros
Thiago from Brazil
