Memory corruption by new group number.

This commit is contained in:
johns 2001-04-19 22:38:09 +00:00
parent 3f09b137eb
commit 99f3029841

View file

@ -382,7 +382,8 @@ local void DrawDecoration(const Unit* unit,const UnitType* type,int x,int y)
//
// Show the number of references.
//
if( x>TheUI.MapX && x<TheUI.MapEndX && y>TheUI.MapY && y<TheUI.MapEndY ) {
if( x>TheUI.MapX && x<TheUI.MapEndX &&
y+8>TheUI.MapY && y+8<TheUI.MapEndY ) {
DrawNumber(x+1,y+1,GameFont,unit->Refs);
}
#endif
@ -612,10 +613,13 @@ local void DrawDecoration(const Unit* unit,const UnitType* type,int x,int y)
buf[0]=unit->GroupId+'0';
buf[1]='\0';
f=TextLength(GameFont,buf);
x-=f+(type->TileWidth*TileSizeX+type->BoxWidth)/2;
y-=14+(type->TileHeight*TileSizeY+type->BoxHeight)/2;
// FIXME: should use FontHeight(GameFont);
DrawNumber(x-f+(type->TileWidth*TileSizeX+type->BoxWidth)/2
,y-14+(type->TileHeight*TileSizeY+type->BoxHeight)/2
,GameFont,unit->GroupId);
if( x>TheUI.MapX && x+f<TheUI.MapEndX && y>TheUI.MapY
&& y+14<TheUI.MapEndY ) {
DrawNumber(x,y,GameFont,unit->GroupId);
}
}
}