mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 00:42:08 +00:00
- fixed handling of bad class assignment to map picnums.
This commit is contained in:
parent
a7ba843eb5
commit
13e19bad36
8 changed files with 13 additions and 11 deletions
|
@ -345,6 +345,7 @@ void ChangeActorSect(DCoreActor* actor, sectortype* sect, bool tail)
|
|||
|
||||
DCoreActor* InsertActor(PClass* type, sectortype* sector, int stat, bool tail)
|
||||
{
|
||||
if (type == nullptr) return nullptr;
|
||||
assert(type->IsDescendantOf(RUNTIME_CLASS(DCoreActor)));
|
||||
if (!type->IsDescendantOf(RUNTIME_CLASS(DCoreActor)))
|
||||
{
|
||||
|
|
|
@ -272,9 +272,13 @@ struct SpawnRec
|
|||
PClass* cls;
|
||||
int param;
|
||||
|
||||
PClass* Class()
|
||||
PClass* Class(int pn)
|
||||
{
|
||||
if (!cls && clsname != NAME_None) cls = PClass::FindClass(clsname);
|
||||
if (cls == nullptr)
|
||||
{
|
||||
Printf(TEXTCOLOR_RED "Bad class name %s for ID# %d\n", clsname.GetChars(), pn);
|
||||
}
|
||||
clsname = NAME_None;
|
||||
return cls;
|
||||
}
|
||||
|
|
|
@ -1014,6 +1014,7 @@ x(FECES, 4802)
|
|||
x(DRONE, 4916)
|
||||
x(RECON, 4989)
|
||||
y(RRTILE5014, 5014)
|
||||
y(RRTILE5015, 5015)
|
||||
y(RRTILE5016, 5016)
|
||||
y(RRTILE5017, 5017)
|
||||
y(RRTILE5018, 5018)
|
||||
|
|
|
@ -937,15 +937,11 @@ static TArray<DDukeActor*> spawnactors(SpawnSpriteDef& sprites)
|
|||
spawns.Pop();
|
||||
continue;
|
||||
}
|
||||
if (i == 210)
|
||||
{
|
||||
int a = 0;
|
||||
}
|
||||
|
||||
|
||||
auto sprt = &sprites.sprites[i];
|
||||
auto info = spawnMap.CheckKey(sprt->picnum);
|
||||
auto actor = static_cast<DDukeActor*>(InsertActor(info? info->Class() : RUNTIME_CLASS(DDukeActor), sprt->sectp, sprt->statnum));
|
||||
auto cls = info ? info->Class(sprt->picnum) : nullptr;;
|
||||
auto actor = static_cast<DDukeActor*>(InsertActor(cls? cls : RUNTIME_CLASS(DDukeActor), sprt->sectp, sprt->statnum));
|
||||
if (actor)
|
||||
{
|
||||
spawns[j++] = actor;
|
||||
|
|
|
@ -552,7 +552,7 @@ void prelevel_r(int g, TArray<DDukeActor*>& actors)
|
|||
geosector[geocnt] = actor->sector();
|
||||
for (auto actor2 : actors)
|
||||
{
|
||||
if (actor->spr.lotag == actor2->spr.lotag && actor2 != actor && actor2->spr.picnum == RRTILE19)
|
||||
if (actor && actor->spr.lotag == actor2->spr.lotag && actor2 != actor && actor2->spr.picnum == RRTILE19)
|
||||
{
|
||||
if (actor2->spr.hitag == 1)
|
||||
{
|
||||
|
|
|
@ -1064,7 +1064,7 @@ void checkhitwall_r(DDukeActor* spr, walltype* wal, const DVector3& pos, int atw
|
|||
}
|
||||
case RRTILE7555:
|
||||
if (!isRRRA()) break;
|
||||
wal->picnum = SBMOVE;
|
||||
wal->picnum = RRTILE5015;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, spr);
|
||||
return;
|
||||
case RRTILE7441:
|
||||
|
|
|
@ -63,7 +63,7 @@ DDukeActor* CreateActor(sectortype* whatsectp, const DVector3& pos, PClassActor*
|
|||
auto info = spawnMap.CheckKey(s_pn);
|
||||
if (info)
|
||||
{
|
||||
clstype = static_cast<PClassActor*>(info->Class());
|
||||
clstype = static_cast<PClassActor*>(info->Class(s_pn));
|
||||
basepicnum = info->param;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -127,7 +127,7 @@ class DukeGPSpeed : DukeActor
|
|||
}
|
||||
|
||||
// the following ones are only used in RR.
|
||||
class TorchCtrl : DukeActor
|
||||
class DukeTorchCtrl : DukeActor
|
||||
{
|
||||
override void StaticSetup()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue