- fixed: The crosshair setting code checked for existence of lumps, not textures and missed anything defined in a TEXTURES lump.

This commit is contained in:
Christoph Oelckers 2014-09-13 09:51:49 +02:00
parent 109da206a6
commit a0f507d18f
1 changed files with 7 additions and 6 deletions

View File

@ -146,7 +146,6 @@ void ST_LoadCrosshair(bool alwaysload)
{
int num = 0;
char name[16], size;
int lump;
if (!crosshairforce &&
players[consoleplayer].camera != NULL &&
@ -179,18 +178,20 @@ void ST_LoadCrosshair(bool alwaysload)
num = -num;
}
size = (SCREENWIDTH < 640) ? 'S' : 'B';
mysnprintf (name, countof(name), "XHAIR%c%d", size, num);
if ((lump = Wads.CheckNumForName (name, ns_graphics)) == -1)
FTextureID texid = TexMan.CheckForTexture(name, FTexture::TEX_MiscPatch, FTextureManager::TEXMAN_TryAny | FTextureManager::TEXMAN_ShortNameOnly);
if (!texid.isValid())
{
mysnprintf (name, countof(name), "XHAIR%c1", size);
if ((lump = Wads.CheckNumForName (name, ns_graphics)) == -1)
texid = TexMan.CheckForTexture(name, FTexture::TEX_MiscPatch, FTextureManager::TEXMAN_TryAny | FTextureManager::TEXMAN_ShortNameOnly);
if (!texid.isValid())
{
strcpy (name, "XHAIRS1");
texid = TexMan.CheckForTexture("XHAIRS1", FTexture::TEX_MiscPatch, FTextureManager::TEXMAN_TryAny | FTextureManager::TEXMAN_ShortNameOnly);
}
num = 1;
}
CrosshairNum = num;
CrosshairImage = TexMan[TexMan.CheckForTexture(name, FTexture::TEX_MiscPatch)];
CrosshairImage = TexMan[texid];
}
//---------------------------------------------------------------------------