Duke fixed two issues with displaying incorrect sprites

* We cannot check a projectiles owner because it may have been destroyed, so copy all info over
* CON changing an actor's type to one without class did not do anything at all.
This commit is contained in:
Christoph Oelckers 2023-10-22 23:01:24 +02:00
parent 272f44786c
commit 9f2808df1f
4 changed files with 11 additions and 8 deletions

View file

@ -2110,10 +2110,10 @@ int ParseState::parse(void)
insptr++;
auto info = spawnMap.CheckKey(*insptr);
if (info != nullptr)
{
g_ac->ChangeType(info->cls);
g_ac->spr.setspritetexture(tileGetTextureID(*insptr));
}
else
g_ac->ChangeType(RUNTIME_CLASS(DDukeActor));
g_ac->spr.setspritetexture(tileGetTextureID(*insptr));
insptr++;
break;
}

View file

@ -58,8 +58,8 @@ spawnclasses
4352 = RedneckRASheriff
4357 = RedneckDeputy
71 = RedneckRASoundFX
7633 = RedneckBarrel
7634 = RedneckBarrel2
//7633 = RedneckBarrel
//7634 = RedneckBarrel2
7636 = DukeGenericDestructible, noskill, "OLDPHOTO0", "OLDPHOTO0BROKE", "VENT_BUST"
7638 = DukeGenericDestructible, noskill, "OLDPHOTO1", "OLDPHOTO1BROKE", "VENT_BUST"

View file

@ -124,6 +124,7 @@ class RedneckBustaWin5a : DukeActor
}
/*
class RedneckBarrel : DukeActor
{
const POWDERKEGBLASTRADIUS = 3880;
@ -141,6 +142,7 @@ class RedneckBarrel2 : RedneckBarrel
spriteset "BARREL2", "BARREL2BROKE";
}
}
*/
class RedneckWaterSurface : DukeActor

View file

@ -25,8 +25,7 @@ class RedneckSawBlade : DukeProjectile
if (self.extra <= 0)
{
self.pos += self.angle.ToVector() * 8;
let Owner = self.ownerActor;
if (!Owner || !(Owner.bALTPROJECTILESPRITE)) // depends on the shooter. Urgh...
if (!bALTPROJECTILESPRITE) // depends on the shooter. Urgh...
{
let j = self.spawn("RedneckCircleStuck");
if (j)
@ -54,7 +53,7 @@ class RedneckSawBlade : DukeProjectile
override bool animate(tspritetype tspr)
{
int frame;
if (!OwnerActor || !(OwnerActor.bALTPROJECTILESPRITE)) frame = ((PlayClock >> 4) & 7);
if (!bALTPROJECTILESPRITE) frame = ((PlayClock >> 4) & 7);
else frame = 8 + ((PlayClock >> 4) & 3);
tspr.SetSpritePic(self, frame);
return true;
@ -72,6 +71,8 @@ class RedneckSawBlade : DukeProjectile
int scount;
if (actor.extra >= 0) actor.shade = -96;
bALTPROJECTILESPRITE = actor.bALTPROJECTILESPRITE; // must copy because shooter may disappear.
scount = 1;
vel = 40.25;