2
0
Michał W. Urbańczyk 18 жил өмнө
parent
commit
10e4e2937f

+ 6 - 0
CCastleInterface.cpp

@@ -115,6 +115,12 @@ public:
 
 CCastleInterface::CCastleInterface(const CGTownInstance * Town, bool Activate)
 {
+	int t = 600;
+	while(t--)
+	{
+		CDefHandler* defik = CGI->spriteh->giveDef("ITMTL.DEF");
+		delete defik;
+	}
 	count=0;
 	town = Town;
 	townInt = CGI->bitmaph->loadBitmap("TOWNSCRN.bmp");

BIN
hch/CDefHandler.cpp


+ 3 - 2
hch/CLodHandler.cpp

@@ -386,7 +386,7 @@ CDefHandler * CLodHandler::giveDef(std::string defName)
 	{
 		outp = new unsigned char[ourEntry->realSize];
 		fread((char*)outp, 1, ourEntry->realSize, FLOD);
-		CDefHandler * nh = new CDefHandler;
+		CDefHandler * nh = new CDefHandler();
 		nh->openFromMemory(outp, ourEntry->realSize, std::string((char*)ourEntry->name));
 		nh->alphaTransformed = false;
 		ret = nh;
@@ -398,10 +398,11 @@ CDefHandler * CLodHandler::giveDef(std::string defName)
 		fseek(FLOD, 0, 0);
 		unsigned char * decomp = NULL;
 		int decRes = infs2(outp, ourEntry->size, ourEntry->realSize, decomp);
-		CDefHandler * nh = new CDefHandler;
+		CDefHandler * nh = new CDefHandler();
 		nh->openFromMemory(decomp, ourEntry->realSize, std::string((char*)ourEntry->name));
 		nh->alphaTransformed = false;
 		ret = nh;
+		delete[] decomp;
 	}
 	delete[] outp;
 	return ret;