mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-01-31 04:20:34 +00:00
- Fixed: Decal actors with an invalid decal texture caused a crash.
SVN r210 (trunk)
This commit is contained in:
parent
e7f21912a5
commit
729e3b346d
2 changed files with 28 additions and 19 deletions
|
@ -1,4 +1,5 @@
|
||||||
June 21, 2006 (Changes by Graf Zahl)
|
June 21, 2006 (Changes by Graf Zahl)
|
||||||
|
- Fixed: Decal actors with an invalid decal texture caused a crash.
|
||||||
- Fixed: Player could crouch while dead.
|
- Fixed: Player could crouch while dead.
|
||||||
- Fixed: The sidedef loader could allocate insufficient memory if a map
|
- Fixed: The sidedef loader could allocate insufficient memory if a map
|
||||||
contained unused sidedefs.
|
contained unused sidedefs.
|
||||||
|
|
|
@ -722,29 +722,37 @@ void ADecal::BeginPlay ()
|
||||||
// If no decal is specified, don't try to create one.
|
// If no decal is specified, don't try to create one.
|
||||||
if (args[0] != 0 && (tpl = DecalLibrary.GetDecalByNum (args[0])) != 0)
|
if (args[0] != 0 && (tpl = DecalLibrary.GetDecalByNum (args[0])) != 0)
|
||||||
{
|
{
|
||||||
// Look for a wall within 64 units behind the actor. If none can be
|
if (tpl->PicNum == 65535)
|
||||||
// found, then no decal is created, and this actor is destroyed
|
|
||||||
// without effectively doing anything.
|
|
||||||
Trace (x, y, z, Sector,
|
|
||||||
finecosine[(angle+ANGLE_180)>>ANGLETOFINESHIFT],
|
|
||||||
finesine[(angle+ANGLE_180)>>ANGLETOFINESHIFT], 0,
|
|
||||||
64*FRACUNIT, 0, 0, NULL, trace, TRACE_NoSky);
|
|
||||||
|
|
||||||
if (trace.HitType == TRACE_HitWall)
|
|
||||||
{
|
{
|
||||||
decal = new DBaseDecal (this);
|
Printf("Decal actor at (%ld,%ld) does not have a valid texture\n", x>>FRACBITS, y>>FRACBITS);
|
||||||
wall = sides + trace.Line->sidenum[trace.Side];
|
|
||||||
decal->StickToWall (wall, trace.X, trace.Y);
|
|
||||||
tpl->ApplyToDecal (decal, wall);
|
|
||||||
// Spread decal to nearby walls if it does not all fit on this one
|
|
||||||
if (cl_spreaddecals)
|
|
||||||
{
|
|
||||||
decal->Spread (tpl, wall, trace.X, trace.Y, z);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DPrintf ("Could not find a wall to stick decal to at (%ld,%ld)\n", x>>FRACBITS, y>>FRACBITS);
|
// Look for a wall within 64 units behind the actor. If none can be
|
||||||
|
// found, then no decal is created, and this actor is destroyed
|
||||||
|
// without effectively doing anything.
|
||||||
|
Trace (x, y, z, Sector,
|
||||||
|
finecosine[(angle+ANGLE_180)>>ANGLETOFINESHIFT],
|
||||||
|
finesine[(angle+ANGLE_180)>>ANGLETOFINESHIFT], 0,
|
||||||
|
64*FRACUNIT, 0, 0, NULL, trace, TRACE_NoSky);
|
||||||
|
|
||||||
|
if (trace.HitType == TRACE_HitWall)
|
||||||
|
{
|
||||||
|
decal = new DBaseDecal (this);
|
||||||
|
wall = sides + trace.Line->sidenum[trace.Side];
|
||||||
|
decal->StickToWall (wall, trace.X, trace.Y);
|
||||||
|
tpl->ApplyToDecal (decal, wall);
|
||||||
|
// Spread decal to nearby walls if it does not all fit on this one
|
||||||
|
if (cl_spreaddecals)
|
||||||
|
{
|
||||||
|
decal->Spread (tpl, wall, trace.X, trace.Y, z);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DPrintf ("Could not find a wall to stick decal to at (%ld,%ld)\n", x>>FRACBITS, y>>FRACBITS);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue