hedgewars/uAmmos.pas
changeset 2453 fdb76012b688
parent 2434 5faa05d99241
child 2457 ecf0c7e7995b
equal deleted inserted replaced
2452:a6edc408a376 2453:fdb76012b688
    60 procedure AddAmmoStore(s: shortstring);
    60 procedure AddAmmoStore(s: shortstring);
    61 const probability: array [0..8] of LongWord = (0,20,30,60,100,150,200,400,600);
    61 const probability: array [0..8] of LongWord = (0,20,30,60,100,150,200,400,600);
    62 var cnt: Longword;
    62 var cnt: Longword;
    63     a: TAmmoType;
    63     a: TAmmoType;
    64     ammos: TAmmoCounts;
    64     ammos: TAmmoCounts;
       
    65     substr: shortstring; // TEMPORARY
    65 begin
    66 begin
    66 TryDo(byte(s[0]) = byte(ord(High(TAmmoType))) * 2, 'Invalid ammo scheme (incompatible frontend)', true);
    67 TryDo(byte(s[0]) = byte(ord(High(TAmmoType))) * 2, 'Invalid ammo scheme (incompatible frontend)', true);
       
    68 
       
    69 // FIXME - TEMPORARY hardcoded check on shoppa pending creation of crate *type* probability editor
       
    70 substr:= Copy(s,1,15);
       
    71 if (substr = '000000990000009') or 
       
    72    (substr = '000000990000000') then
       
    73     shoppa:= true;
    67 
    74 
    68 inc(StoreCnt);
    75 inc(StoreCnt);
    69 TryDo(StoreCnt <= cMaxHHs, 'Ammo stores overflow', true);
    76 TryDo(StoreCnt <= cMaxHHs, 'Ammo stores overflow', true);
    70 
    77 
    71 new(StoresList[Pred(StoreCnt)]);
    78 new(StoresList[Pred(StoreCnt)]);