src/saveload.cpp
changeset 9455 955a7bd9027f
parent 9413 7042a8ec3fa8
child 9457 75f11a6caef8
equal deleted inserted replaced
9454:25e15b3ebf5a 9455:955a7bd9027f
   649 	}
   649 	}
   650 
   650 
   651 	/* NOTICE - handle some buggy stuff, in really old versions everything was saved
   651 	/* NOTICE - handle some buggy stuff, in really old versions everything was saved
   652 	 * as a byte-type. So detect this, and adjust array size accordingly */
   652 	 * as a byte-type. So detect this, and adjust array size accordingly */
   653 	if (!_sl.save && _sl_version == 0) {
   653 	if (!_sl.save && _sl_version == 0) {
       
   654 		/* all arrays except difficulty settings */
   654 		if (conv == SLE_INT16 || conv == SLE_UINT16 || conv == SLE_STRINGID ||
   655 		if (conv == SLE_INT16 || conv == SLE_UINT16 || conv == SLE_STRINGID ||
   655 				conv == SLE_INT32 || conv == SLE_UINT32) {
   656 				conv == SLE_INT32 || conv == SLE_UINT32) {
   656 			length *= SlCalcConvFileLen(conv);
   657 			SlCopyBytes(array, length * SlCalcConvFileLen(conv));
   657 			conv = SLE_INT8;
   658 			return;
       
   659 		}
       
   660 		/* used for conversion of Money 32bit->64bit */
       
   661 		if (conv == (SLE_FILE_I32 | SLE_VAR_I64)) {
       
   662 			for (uint i = 0; i < length; i++) {
       
   663 				((int64*)array)[i] = (int32)BSWAP32(SlReadUint32());
       
   664 			}
       
   665 			return;
   658 		}
   666 		}
   659 	}
   667 	}
   660 
   668 
   661 	/* If the size of elements is 1 byte both in file and memory, no special
   669 	/* If the size of elements is 1 byte both in file and memory, no special
   662 	 * conversion is needed, use specialized copy-copy function to speed up things */
   670 	 * conversion is needed, use specialized copy-copy function to speed up things */