From: hgn Date: Fri, 26 Nov 2021 16:22:30 +0000 (+0000) Subject: fixed windows line-endings messing stuff up X-Git-Url: https://harrygodden.com/git/?p=fishladder.git;a=commitdiff_plain;h=17d104181ae9f3b9cb16dab5ba3164d2f469233d fixed windows line-endings messing stuff up --- diff --git a/build.sh b/build.sh index ab013e2..c24169d 100755 --- a/build.sh +++ b/build.sh @@ -83,6 +83,7 @@ if [[ "$OSTYPE" == "linux-gnu"* ]]; then mkdir build.linux/textures -p mkdir build.linux/sound -p mkdir build.linux/maps -p + mkdir build.linux/sav -p cp $target ./build.linux/$target cp ./steam/libsteam_api.so ./build.linux/libsteam_api.so @@ -102,6 +103,7 @@ else mkdir build.win32/textures -p mkdir build.win32/sound -p mkdir build.win32/maps -p + mkdir build.win32/sav -p cp $target ./build.win32/$target cp -r ./textures/ ./build.win32/ diff --git a/fishladder.c b/fishladder.c index e7cd191..68f04fe 100644 --- a/fishladder.c +++ b/fishladder.c @@ -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 {