mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-26 05:51:20 +00:00
- Fixed: Weapons did not give you double ammo at baby and nightmare skills.
- Fixed: SetTexture() in p_setup.cpp assumed that all color values were six characters. Although this was the intended way to specify colors, earlier versions did no error checking, so other lengths worked too. - Fixed: FPatchTexture waited until MakeTexture() to call CalcBitSize(), so the width and height bit sizes weren't available when using it as a source for a warp texture. - Fixed: R_InitSkyMap() should only warn about two sky textures not being the same height when they are used as part of a double sky. - Added a NULL state check in AActor::Tick() before advancing the current state. Note that this should not happen, so there's an assert there for the debug build as well as a regular check for the release build. SVN r324 (trunk)
This commit is contained in:
parent
05265c3213
commit
4999c3b4aa
8 changed files with 52 additions and 17 deletions
|
@ -1,3 +1,17 @@
|
|||
September 8, 2006
|
||||
- Fixed: Weapons did not give you double ammo at baby and nightmare skills.
|
||||
- Fixed: SetTexture() in p_setup.cpp assumed that all color values were
|
||||
six characters. Although this was the intended way to specify colors,
|
||||
earlier versions did no error checking, so other lengths worked too.
|
||||
- Fixed: FPatchTexture waited until MakeTexture() to call CalcBitSize(),
|
||||
so the width and height bit sizes weren't available when using it as a
|
||||
source for a warp texture.
|
||||
- Fixed: R_InitSkyMap() should only warn about two sky textures not being
|
||||
the same height when they are used as part of a double sky.
|
||||
- Added a NULL state check in AActor::Tick() before advancing the current
|
||||
state. Note that this should not happen, so there's an assert there for
|
||||
the debug build as well as a regular check for the release build.
|
||||
|
||||
September 1, 2006
|
||||
- Version bump to 2.1.5.
|
||||
- Fixed: P_LoadSegs() checked for invalid vertices too late.
|
||||
|
|
|
@ -79,7 +79,7 @@ bool AAmmo::HandlePickup (AInventory *item)
|
|||
if (gameskill == sk_baby || (gameskill == sk_nightmare && gameinfo.gametype != GAME_Strife))
|
||||
{
|
||||
if (gameinfo.gametype & (GAME_Doom|GAME_Strife))
|
||||
receiving <<= 1;
|
||||
receiving += receiving;
|
||||
else
|
||||
receiving += receiving >> 1;
|
||||
}
|
||||
|
|
|
@ -202,6 +202,7 @@ AInventory *AWeapon::CreateTossable ()
|
|||
{
|
||||
SisterWeapon->Destroy ();
|
||||
}
|
||||
// To avoid exploits, the tossed weapon must not have any ammo.
|
||||
copy->AmmoGive1 = 0;
|
||||
copy->AmmoGive2 = 0;
|
||||
}
|
||||
|
@ -250,6 +251,14 @@ AAmmo *AWeapon::AddAmmo (AActor *other, const PClass *ammotype, int amount)
|
|||
{
|
||||
return NULL;
|
||||
}
|
||||
// extra ammo in baby mode and nightmare mode
|
||||
if (gameskill == sk_baby || (gameskill == sk_nightmare && gameinfo.gametype != GAME_Strife))
|
||||
{
|
||||
if (gameinfo.gametype & (GAME_Doom|GAME_Strife))
|
||||
amount += amount;
|
||||
else
|
||||
amount += amount >> 1;
|
||||
}
|
||||
ammo = static_cast<AAmmo *>(other->FindInventory (ammotype));
|
||||
if (ammo == NULL)
|
||||
{
|
||||
|
@ -280,6 +289,14 @@ bool AWeapon::AddExistingAmmo (AAmmo *ammo, int amount)
|
|||
{
|
||||
if (ammo != NULL && ammo->Amount < ammo->MaxAmount)
|
||||
{
|
||||
// extra ammo in baby mode and nightmare mode
|
||||
if (gameskill == sk_baby || (gameskill == sk_nightmare && gameinfo.gametype != GAME_Strife))
|
||||
{
|
||||
if (gameinfo.gametype & (GAME_Doom|GAME_Strife))
|
||||
amount += amount;
|
||||
else
|
||||
amount += amount >> 1;
|
||||
}
|
||||
ammo->Amount += amount;
|
||||
if (ammo->Amount > ammo->MaxAmount)
|
||||
{
|
||||
|
|
|
@ -2479,6 +2479,13 @@ void AActor::Tick ()
|
|||
AActor *onmo;
|
||||
int i;
|
||||
|
||||
assert (state != NULL);
|
||||
if (state == NULL)
|
||||
{
|
||||
Destroy();
|
||||
return;
|
||||
}
|
||||
|
||||
PrevX = x;
|
||||
PrevY = y;
|
||||
PrevZ = z;
|
||||
|
@ -2895,6 +2902,12 @@ void AActor::Tick ()
|
|||
// of 0 tics work as expected.
|
||||
if (tics <= 0)
|
||||
{
|
||||
assert (state != NULL);
|
||||
if (state == NULL)
|
||||
{
|
||||
Destroy();
|
||||
return;
|
||||
}
|
||||
if (!SetState (state->GetNextState()))
|
||||
return; // freed itself
|
||||
}
|
||||
|
|
|
@ -428,7 +428,7 @@ static void SetTextureNoErr (short *texture, DWORD *color, char *name8, bool *va
|
|||
name2[8] = 0;
|
||||
*color = strtoul (name2, &stop, 16);
|
||||
*texture = 0;
|
||||
*validcolor = (*stop == 0) && (stop == name2 + 6);
|
||||
*validcolor = (*stop == 0) && (stop >= name2 + 2) && (stop <= name2 + 6);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -79,7 +79,7 @@ void R_InitSkyMap ()
|
|||
if (skytex1 == NULL)
|
||||
return;
|
||||
|
||||
if (skytex1->GetHeight() != skytex2->GetHeight())
|
||||
if ((level.flags & LEVEL_DOUBLESKY) && skytex1->GetHeight() != skytex2->GetHeight())
|
||||
{
|
||||
Printf (TEXTCOLOR_BOLD "Both sky textures must be the same height." TEXTCOLOR_NORMAL "\n");
|
||||
sky2texture = sky1texture;
|
||||
|
|
|
@ -102,6 +102,7 @@ FPatchTexture::FPatchTexture (int lumpnum, patch_t * header)
|
|||
Height = header->height;
|
||||
LeftOffset = header->leftoffset;
|
||||
TopOffset = header->topoffset;
|
||||
CalcBitSize ();
|
||||
}
|
||||
|
||||
FPatchTexture::~FPatchTexture ()
|
||||
|
@ -185,15 +186,6 @@ void FPatchTexture::MakeTexture ()
|
|||
Printf (PRINT_BOLD, "Patch %s is too big.\n", Name);
|
||||
}
|
||||
|
||||
if (Width == 0xFFFF)
|
||||
{
|
||||
Width = LittleShort(patch->width);
|
||||
Height = LittleShort(patch->height);
|
||||
LeftOffset = LittleShort(patch->leftoffset);
|
||||
TopOffset = LittleShort(patch->topoffset);
|
||||
}
|
||||
CalcBitSize ();
|
||||
|
||||
// Add a little extra space at the end if the texture's height is not
|
||||
// a power of 2, in case somebody accidentally makes it repeat vertically.
|
||||
int numpix = Width * Height + (1 << HeightBits) - Height;
|
||||
|
|
|
@ -214,9 +214,10 @@ void FWarp2Texture::MakeTexture (DWORD time)
|
|||
}
|
||||
|
||||
DWORD timebase = time * 40 / 28;
|
||||
for (x = xsize-1; x >= 0; x--)
|
||||
for (x = 0; x < xsize; ++x)
|
||||
{
|
||||
for (y = ysize-1; y >= 0; y--)
|
||||
BYTE *dest = Pixels + (x << ybits);
|
||||
for (y = 0; y < ysize; ++y)
|
||||
{
|
||||
int xt = (x + 128
|
||||
+ ((finesine[(y*128 + timebase*5 + 900) & FINEMASK]*2)>>FRACBITS)
|
||||
|
@ -224,9 +225,7 @@ void FWarp2Texture::MakeTexture (DWORD time)
|
|||
int yt = (y + 128
|
||||
+ ((finesine[(y*128 + timebase*3 + 700) & FINEMASK]*2)>>FRACBITS)
|
||||
+ ((finesine[(x*256 + timebase*4 + 1200) & FINEMASK]*2)>>FRACBITS)) & ymask;
|
||||
const BYTE *source = otherpix + (xt << ybits) + yt;
|
||||
BYTE *dest = Pixels + (x << ybits) + y;
|
||||
*dest = *source;
|
||||
*dest++ = otherpix[(xt << ybits) + yt];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue