comparison Items.cpp @ 705:e39702f35283

memory allocation partly reworked
author zipi
date Mon, 18 Mar 2013 21:50:20 +0000
parents f8a4a2e0b4c9
children cf2fbac6edc9
comparison
equal deleted inserted replaced
704:ef4d646d738d 705:e39702f35283
914 ++item_counter; 914 ++item_counter;
915 if (item_counter>618) 915 if (item_counter>618)
916 break; 916 break;
917 } 917 }
918 918
919 if ( pRndItemsTXT_Raw )
920 {
921 pAllocator->FreeChunk(pRndItemsTXT_Raw);
922 pRndItemsTXT_Raw = NULL;
923 }
924 //ChanceByTreasureLvl Summ - anti cheating? 919 //ChanceByTreasureLvl Summ - anti cheating?
925 memset(&uChanceByTreasureLvlSumm, 0, 24); 920 memset(&uChanceByTreasureLvlSumm, 0, 24);
926 for(i=0;i<6;++i) 921 for(i=0;i<6;++i)
927 { 922 {
928 for (j=1;j<item_counter;++j) 923 for (j=1;j<item_counter;++j)
1048 break_loop = true; 1043 break_loop = true;
1049 } 1044 }
1050 ++decode_step; 1045 ++decode_step;
1051 test_string=tmp_pos+1; 1046 test_string=tmp_pos+1;
1052 } while ((decode_step<8)&&!break_loop); 1047 } while ((decode_step<8)&&!break_loop);
1048 }
1049
1050 if ( pRndItemsTXT_Raw )
1051 {
1052 pAllocator->FreeChunk(pRndItemsTXT_Raw);
1053 pRndItemsTXT_Raw = NULL;
1053 } 1054 }
1054 1055
1055 pSkillDescTXT_Raw = NULL; 1056 pSkillDescTXT_Raw = NULL;
1056 pSkillDescTXT_Raw = (char *)pEvents_LOD->LoadRaw("skilldes.txt", 0); 1057 pSkillDescTXT_Raw = (char *)pEvents_LOD->LoadRaw("skilldes.txt", 0);
1057 strtok(pSkillDescTXT_Raw, "\r"); 1058 strtok(pSkillDescTXT_Raw, "\r");