mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Fixed uninitialized variables.
This commit is contained in:
parent
a7b7b0a431
commit
6312a55bac
@ -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 );
|
||||
for(int i=0; i<dh->ourImages.size(); ++i) //transforming images
|
||||
|
@ -129,7 +129,6 @@ void CDefHandler::openDef(std::string name)
|
||||
void CDefHandler::openFromMemory(unsigned char *table, std::string name)
|
||||
{
|
||||
int i,j, totalInBlock;
|
||||
char Buffer[13];
|
||||
BMPPalette palette[256];
|
||||
defName=name;
|
||||
i = 0;
|
||||
@ -161,9 +160,12 @@ void CDefHandler::openFromMemory(unsigned char *table, std::string name)
|
||||
i+=4;
|
||||
for (j=0; j<totalInBlock; j++)
|
||||
{
|
||||
for (int k=0;k<13;k++) Buffer[k]=table[i+k];
|
||||
i+=13;
|
||||
char Buffer[13];
|
||||
memcpy(Buffer, &table[i], 12);
|
||||
Buffer[12] = 0;
|
||||
SEntries[totalEntries+j].name=Buffer;
|
||||
|
||||
i+=13;
|
||||
}
|
||||
for (j=0; j<totalInBlock; j++)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user