fixed windows line-endings messing stuff up
[fishladder.git] / fishladder.c
index e7cd191add03093edde65cec9982454be901e139..68f04febd75e54bd42da4c043bf3d956d0503caf 100644 (file)
@@ -314,15 +314,21 @@ static int map_load( const char *str, const char *name )
                if( !*c )
                        break;
        
+               if( *c == '\r' ) { c ++; continue; } // fuck off windows
+       
                if( *c == ';' )
                {
                        c ++;
-
+                       
+                       if( *c == '\r' ) c ++;
+                       
                        // Parse attribs
                        if( *c != '\n' )
                        {
                                while( *c )
                                {
+                                       if( *c == '\r' ) { c ++; continue; }
+                                       
                                        if( reg_start < reg_end )
                                        {
                                                struct cell_terminal *terminal = &world.io[ reg_start ];
@@ -736,12 +742,12 @@ static int console_changelevel( int argc, char const *argv[] )
        if( argc >= 1 )
        {
                // Save current level
-               if( console_save_map( 0, NULL ) )
-                       if( console_load_map( argc, argv ) )
-                       {                               
-                               simulation_stop();
-                               return 1;
-                       }
+               console_save_map( 0, NULL );
+               if( console_load_map( argc, argv ) )
+               {                               
+                       simulation_stop();
+                       return 1;
+               }
        }
        else
        {