Changeset 689

Show
Ignore:
Timestamp:
02/06/08 10:00:49 (10 months ago)
Author:
takkaria
Message:

Remove support for pre-3.0.1 savefiles.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/defines.h

    r681 r689  
    5252 * Oldest version number that can still be imported 
    5353 */ 
    54 #define OLD_VERSION_MAJOR       2 
    55 #define OLD_VERSION_MINOR       9 
    56 #define OLD_VERSION_PATCH       0 
     54#define OLD_VERSION_MAJOR       3 
     55#define OLD_VERSION_MINOR       0 
     56#define OLD_VERSION_PATCH       1 
    5757 
    5858 
  • trunk/src/load.c

    r678 r689  
    10181018        u16b tmp16u; 
    10191019 
    1020         if (older_than(2, 9, 8)) 
    1021         { 
    1022                 /* The magic spells were changed drastically in Angband 2.9.7 */ 
    1023                 if (older_than(2, 9, 7) && 
    1024                     (c_info[p_ptr->pclass].spell_book == TV_MAGIC_BOOK)) 
    1025                 { 
    1026                         /* Discard old spell info */ 
    1027                         strip_bytes(24); 
    1028  
    1029                         /* Discard old spell order */ 
    1030                         strip_bytes(64); 
    1031  
    1032                         /* None of the spells have been learned yet */ 
    1033                         for (i = 0; i < 64; i++) 
    1034                                 p_ptr->spell_order[i] = 99; 
    1035                 } 
    1036                 else 
    1037                 { 
    1038                         u32b spell_learned1, spell_learned2; 
    1039                         u32b spell_worked1, spell_worked2; 
    1040                         u32b spell_forgotten1, spell_forgotten2; 
    1041  
    1042                         /* Read spell info */ 
    1043                         rd_u32b(&spell_learned1); 
    1044                         rd_u32b(&spell_learned2); 
    1045                         rd_u32b(&spell_worked1); 
    1046                         rd_u32b(&spell_worked2); 
    1047                         rd_u32b(&spell_forgotten1); 
    1048                         rd_u32b(&spell_forgotten2); 
    1049  
    1050                         for (i = 0; i < 64; i++) 
    1051                         { 
    1052                                 if (i < 32) 
    1053                                 { 
    1054                                         if (spell_learned1 & (1L << i)) 
    1055                                                 p_ptr->spell_flags[i] |= PY_SPELL_LEARNED; 
    1056                                         if (spell_worked1 & (1L << i)) 
    1057                                                 p_ptr->spell_flags[i] |= PY_SPELL_WORKED; 
    1058                                         if (spell_forgotten1 & (1L << i)) 
    1059                                                 p_ptr->spell_flags[i] |= PY_SPELL_FORGOTTEN; 
    1060                                 } 
    1061                                 else 
    1062                                 { 
    1063                                         if (spell_learned2 & (1L << (i - 32))) 
    1064                                                 p_ptr->spell_flags[i] |= PY_SPELL_LEARNED; 
    1065                                         if (spell_worked2 & (1L << (i - 32))) 
    1066                                                 p_ptr->spell_flags[i] |= PY_SPELL_WORKED; 
    1067                                         if (spell_forgotten2 & (1L << (i - 32))) 
    1068                                                 p_ptr->spell_flags[i] |= PY_SPELL_FORGOTTEN; 
    1069                                 } 
    1070                         } 
    1071  
    1072                         for (i = 0; i < 64; i++) 
    1073                         { 
    1074                                 rd_byte(&p_ptr->spell_order[i]); 
    1075                         } 
    1076                 } 
    1077         } 
    1078         else 
    1079         { 
    1080                 int cnt; 
    1081  
    1082                 /* Read the number of spells */ 
    1083                 rd_u16b(&tmp16u); 
    1084                 if (tmp16u > PY_MAX_SPELLS) 
    1085                 { 
    1086                         note(format("Too many player spells (%d).", tmp16u)); 
    1087                         return (-1); 
    1088                 } 
    1089  
    1090                 /* Read the spell flags */ 
    1091                 for (i = 0; i < tmp16u; i++) 
    1092                 { 
    1093                         rd_byte(&p_ptr->spell_flags[i]); 
    1094                         if (i == 7) 
    1095                                 p_ptr->spell_flags[i] = 0; 
    1096                 } 
    1097  
    1098                 /* Read the spell order */ 
    1099                 for (i = 0, cnt = 0; i < tmp16u; i++, cnt++) 
    1100                 { 
    1101                         rd_byte(&p_ptr->spell_order[cnt]); 
    1102                         if (p_ptr->spell_order[cnt] == 7) 
    1103                                 cnt--; 
    1104                 } 
     1020        int cnt; 
     1021 
     1022        /* Read the number of spells */ 
     1023        rd_u16b(&tmp16u); 
     1024        if (tmp16u > PY_MAX_SPELLS) 
     1025        { 
     1026                note(format("Too many player spells (%d).", tmp16u)); 
     1027                return (-1); 
     1028        } 
     1029 
     1030        /* Read the spell flags */ 
     1031        for (i = 0; i < tmp16u; i++) 
     1032        { 
     1033                rd_byte(&p_ptr->spell_flags[i]); 
     1034                if (i == 7) 
     1035                        p_ptr->spell_flags[i] = 0; 
     1036        } 
     1037 
     1038        /* Read the spell order */ 
     1039        for (i = 0, cnt = 0; i < tmp16u; i++, cnt++) 
     1040        { 
     1041                rd_byte(&p_ptr->spell_order[cnt]); 
     1042                if (p_ptr->spell_order[cnt] == 7) 
     1043                        cnt--; 
    11051044        } 
    11061045 
     
    11911130 
    11921131        rd_string(op_ptr->full_name, sizeof(op_ptr->full_name)); 
    1193  
    11941132        rd_string(p_ptr->died_from, 80); 
    1195  
    1196         if (older_than(3, 0, 1)) 
    1197         { 
    1198                 char *hist = p_ptr->history; 
    1199  
    1200                 for (i = 0; i < 4; i++) 
    1201                 { 
    1202                         /* Read a part of the history */ 
    1203                         rd_string(hist, 60); 
    1204  
    1205                         /* Advance */ 
    1206                         hist += strlen(hist); 
    1207  
    1208                         /* Separate by spaces */ 
    1209                         hist[0] = ' '; 
    1210                         hist++; 
    1211                 } 
    1212  
    1213                 /* Make sure it is terminated */ 
    1214                 hist[0] = '\0'; 
    1215         } 
    1216         else 
    1217         { 
    1218                 rd_string(p_ptr->history, 250); 
    1219         } 
     1133        rd_string(p_ptr->history, 250); 
    12201134 
    12211135        /* Player race */ 
     
    16931607 
    16941608                /* Read the message type */ 
    1695                 if (!older_than(2, 9, 1)) 
    1696                         rd_u16b(&tmp16u); 
    1697                 else 
    1698                         tmp16u = MSG_GENERIC; 
     1609                rd_u16b(&tmp16u); 
    16991610 
    17001611                /* Save the message */ 
     
    20131924        character_dungeon = TRUE; 
    20141925 
    2015         /* Regenerate town in post 2.9.3 versions */ 
    2016         if (older_than(2, 9, 4) && (p_ptr->depth == 0)) 
     1926#if 0 
     1927        /* Regenerate town in old versions */ 
     1928        if (p_ptr->depth == 0) 
    20171929                character_dungeon = FALSE; 
     1930#endif 
    20181931 
    20191932        /* Success */