src/console_cmds.cpp
branchNewGRF_ports
changeset 6878 7d1ff2f621c7
parent 6872 1c4a4a609f85
child 10184 fcf5fb2548eb
equal deleted inserted replaced
6877:889301acc299 6878:7d1ff2f621c7
   808 		return true;
   808 		return true;
   809 	}
   809 	}
   810 
   810 
   811 	if (argc < 2) return false;
   811 	if (argc < 2) return false;
   812 
   812 
   813 	_script_file = fopen(argv[1], "r");
   813 	_script_file = FioFOpenFile(argv[1], "r", BASE_DIR);
   814 
   814 
   815 	if (_script_file == NULL) {
   815 	if (_script_file == NULL) {
   816 		if (argc == 2 || atoi(argv[2]) != 0) IConsoleError("script file not found");
   816 		if (argc == 2 || atoi(argv[2]) != 0) IConsoleError("script file not found");
   817 		return true;
   817 		return true;
   818 	}
   818 	}
   832 
   832 
   833 	if (ferror(_script_file))
   833 	if (ferror(_script_file))
   834 		IConsoleError("Encountered errror while trying to read from script file");
   834 		IConsoleError("Encountered errror while trying to read from script file");
   835 
   835 
   836 	_script_running = false;
   836 	_script_running = false;
   837 	fclose(_script_file);
   837 	FioFCloseFile(_script_file);
   838 	return true;
   838 	return true;
   839 }
   839 }
   840 
   840 
   841 DEF_CONSOLE_CMD(ConReturn)
   841 DEF_CONSOLE_CMD(ConReturn)
   842 {
   842 {