- added the missing Level parameters to AActor::StaticSpawn and P_ExecuteSpecial.

I think these were the last two still missing it, all remaining uses of the global level variable are in code that doesn't get run through a level tick and are supposed to access the primary level.
This commit is contained in:
Christoph Oelckers 2019-02-01 22:02:16 +01:00
commit 6c006a5fbd
25 changed files with 124 additions and 233 deletions

View file

@ -4440,7 +4440,7 @@ AActor *P_LineAttack(AActor *t1, DAngle angle, double distance,
AActor *tempuff = NULL;
if (pufftype != NULL)
tempuff = Spawn(pufftype, t1->Pos(), ALLOW_REPLACE);
tempuff = Spawn(t1->Level, pufftype, t1->Pos(), ALLOW_REPLACE);
if (tempuff != NULL)
{
TData.PuffSpecies = tempuff->GetSpecies();
@ -5185,7 +5185,7 @@ void P_RailAttack(FRailParams *p)
// used as damage inflictor
AActor *thepuff = NULL;
if (puffclass != NULL) thepuff = Spawn(puffclass, source->Pos(), ALLOW_REPLACE);
if (puffclass != NULL) thepuff = Spawn(source->Level, puffclass, source->Pos(), ALLOW_REPLACE);
rail_data.PuffSpecies = (thepuff != NULL) ? thepuff->GetSpecies() : NAME_None;
Trace(start, source->Sector, vec, p->distance, MF_SHOOTABLE, ML_BLOCKEVERYTHING, source, trace, flags, ProcessRailHit, &rail_data);
@ -6181,7 +6181,7 @@ void P_DoCrunch(AActor *thing, FChangePosition *cpos)
{
AActor *mo;
mo = Spawn(bloodcls, thing->PosPlusZ(thing->Height / 2), ALLOW_REPLACE);
mo = Spawn(thing->Level, bloodcls, thing->PosPlusZ(thing->Height / 2), ALLOW_REPLACE);
mo->Vel.X = pr_crunch.Random2() / 16.;
mo->Vel.Y = pr_crunch.Random2() / 16.;
@ -6825,7 +6825,7 @@ bool P_ActivateThingSpecial(AActor * thing, AActor * trigger, bool death)
// Run the special, if any
if (thing->special)
{
res = !!P_ExecuteSpecial(thing->special, NULL,
res = !!P_ExecuteSpecial(thing->Level, thing->special, NULL,
// TriggerActs overrides the level flag, which only concerns thing activated by death
(((death && thing->Level->flags & LEVEL_ACTOWNSPECIAL && !(thing->activationtype & THINGSPEC_TriggerActs))
|| (thing->activationtype & THINGSPEC_ThingActs)) // Who triggers?