Changeset 120 for trunk/GameServer.pas


Ignore:
Timestamp:
Feb 3, 2018, 5:03:31 PM (7 years ago)
Author:
chronos
Message:
  • Added: Special Delphi random number generator algorithm. It is needed to correctly open stored books. Saved games depends on stored randseed and random generator algorithm which is pretty bad design.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GameServer.pas

    r105 r120  
    295295  MapSize := lx * ly;
    296296  LandMass := lm;
    297   RandSeed := PreviewRND;
     297  DelphiRandSeed := PreviewRND;
    298298  if not PreviewElevation then
    299299  begin
     
    714714        bix[p1] := -1
    715715      else
    716         bix[p1] := bixFirstAI + random(nBrain - bixFirstAI)
     716        bix[p1] := bixFirstAI + Delphirandom(nBrain - bixFirstAI)
    717717    else
    718718      bix[p1] := bixView[p1];
     
    838838          RW[p].DefaultDebugMap := nil;
    839839
    840         { !!!for i:=0 to nShipPart-1 do GShip[p].Parts[i]:=random((3-i)*2);{ }
     840        { !!!for i:=0 to nShipPart-1 do GShip[p].Parts[i]:=Delphirandom((3-i)*2);{ }
    841841      end;
    842842
     
    13711371    LandMass := NewLandMass;
    13721372  MaxTurn := NewMaxTurn;
    1373   Randomize;
    1374   RND := RandSeed;
     1373  DelphiRandomize;
     1374  RND := DelphiRandSeed;
    13751375  Mode := moPlaying;
    13761376  CL := TCmdList.Create;
     
    14161416  InitBrain(bixTerm);
    14171417
    1418   Randomize;
     1418  DelphiRandomize;
    14191419  GAlive := 0;
    14201420  GWatching := 1;
Note: See TracChangeset for help on using the changeset viewer.