Browse Source

fixed a bug when calculating the world generator seed

Kolja Strohm 3 years ago
parent
commit
5390ccb98d
2 changed files with 2 additions and 3 deletions
  1. 1 1
      FactoryCraft/Game.cpp
  2. 1 2
      FactoryCraft/WorldLoader.cpp

+ 1 - 1
FactoryCraft/Game.cpp

@@ -162,7 +162,7 @@ Game::Game( Framework::Text name, Framework::Text worldsDir )
     }
     int seed = 0;
     int index = 0;
-    for( char *n = name; n; n++ )
+    for( char *n = name; *n; n++ )
         seed += (int)pow( (float)*n * 31, ( float )++index );
     generator = new WorldGenerator( seed, this );
     loader = new WorldLoader( this );

+ 1 - 2
FactoryCraft/WorldLoader.cpp

@@ -12,8 +12,7 @@ WorldLoader::WorldLoader( Game *zGame )
     zGame( zGame ),
     exit( 0 )
 {
-    oader i
-        Datei d;
+    Datei d;
     d.setDatei( zGame->getWorldDirectory() + "/dim" );
     RCArray<Text> *names = d.getDateiListe();
     if( names )