1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-26 22:57:00 +02:00

Fixed uninitialized variables.

This commit is contained in:
Frank Zago 2009-08-19 05:00:59 +00:00
parent a7b7b0a431
commit 6312a55bac
2 changed files with 6 additions and 4 deletions

View File

@ -2444,7 +2444,7 @@ void CBattleHero::clickLeft(tribool down, bool previousState)
} }
} }
CBattleHero::CBattleHero(const std::string & defName, int phaseG, int imageG, bool flipG, unsigned char player, const CGHeroInstance * hero, const CBattleInterface * owner): flip(flipG), myHero(hero), myOwner(owner), phase(phaseG), nextPhase(-1), image(imageG), flagAnim(0) CBattleHero::CBattleHero(const std::string & defName, int phaseG, int imageG, bool flipG, unsigned char player, const CGHeroInstance * hero, const CBattleInterface * owner): flip(flipG), myHero(hero), myOwner(owner), phase(phaseG), nextPhase(-1), image(imageG), flagAnim(0), flagAnimCount(0)
{ {
dh = CDefHandler::giveDef( defName ); dh = CDefHandler::giveDef( defName );
for(int i=0; i<dh->ourImages.size(); ++i) //transforming images for(int i=0; i<dh->ourImages.size(); ++i) //transforming images

View File

@ -129,7 +129,6 @@ void CDefHandler::openDef(std::string name)
void CDefHandler::openFromMemory(unsigned char *table, std::string name) void CDefHandler::openFromMemory(unsigned char *table, std::string name)
{ {
int i,j, totalInBlock; int i,j, totalInBlock;
char Buffer[13];
BMPPalette palette[256]; BMPPalette palette[256];
defName=name; defName=name;
i = 0; i = 0;
@ -161,9 +160,12 @@ void CDefHandler::openFromMemory(unsigned char *table, std::string name)
i+=4; i+=4;
for (j=0; j<totalInBlock; j++) for (j=0; j<totalInBlock; j++)
{ {
for (int k=0;k<13;k++) Buffer[k]=table[i+k]; char Buffer[13];
i+=13; memcpy(Buffer, &table[i], 12);
Buffer[12] = 0;
SEntries[totalEntries+j].name=Buffer; SEntries[totalEntries+j].name=Buffer;
i+=13;
} }
for (j=0; j<totalInBlock; j++) for (j=0; j<totalInBlock; j++)
{ {