diff Items.cpp @ 705:e39702f35283

memory allocation partly reworked
author zipi
date Mon, 18 Mar 2013 21:50:20 +0000
parents f8a4a2e0b4c9
children cf2fbac6edc9
line wrap: on
line diff
--- a/Items.cpp	Tue Mar 19 01:36:47 2013 +0400
+++ b/Items.cpp	Mon Mar 18 21:50:20 2013 +0000
@@ -916,11 +916,6 @@
 				break;
 		}
 
-	if ( pRndItemsTXT_Raw )
-		{
-		pAllocator->FreeChunk(pRndItemsTXT_Raw);
-		pRndItemsTXT_Raw = NULL;
-		}
 	//ChanceByTreasureLvl Summ - anti cheating?
 	memset(&uChanceByTreasureLvlSumm, 0, 24);
 	for(i=0;i<6;++i)
@@ -1052,6 +1047,12 @@
 			} while ((decode_step<8)&&!break_loop);
 		}
 
+	if ( pRndItemsTXT_Raw )
+		{
+		pAllocator->FreeChunk(pRndItemsTXT_Raw);
+		pRndItemsTXT_Raw = NULL;
+		}
+
 	pSkillDescTXT_Raw = NULL;
 	pSkillDescTXT_Raw = (char *)pEvents_LOD->LoadRaw("skilldes.txt", 0);
 	strtok(pSkillDescTXT_Raw, "\r");