mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-03-13 22:42:07 +00:00
- added a level parameter to the thinker iterator.
Not used yet, but will be when the thinker lists are moved into FLevelLocals.
This commit is contained in:
parent
4ec2d31e9f
commit
1b1e2ef7d2
53 changed files with 197 additions and 152 deletions
|
@ -2941,13 +2941,13 @@ void AM_drawPlayers ()
|
|||
//
|
||||
//=============================================================================
|
||||
|
||||
void AM_drawKeys ()
|
||||
void AM_drawKeys (FLevelLocals *Level)
|
||||
{
|
||||
AMColor color;
|
||||
mpoint_t p;
|
||||
DAngle angle;
|
||||
|
||||
TThinkerIterator<AActor> it(NAME_Key);
|
||||
TThinkerIterator<AActor> it(Level, NAME_Key);
|
||||
AActor *key;
|
||||
|
||||
while ((key = it.Next()) != NULL)
|
||||
|
@ -3171,7 +3171,7 @@ void AM_drawAuthorMarkers (FLevelLocals *Level)
|
|||
// [RH] Draw any actors derived from AMapMarker on the automap.
|
||||
// If args[0] is 0, then the actor's sprite is drawn at its own location.
|
||||
// Otherwise, its sprite is drawn at the location of any actors whose TIDs match args[0].
|
||||
TThinkerIterator<AActor> it ("MapMarker", STAT_MAPMARKER);
|
||||
TThinkerIterator<AActor> it (Level, "MapMarker", STAT_MAPMARKER);
|
||||
AActor *mark;
|
||||
|
||||
while ((mark = it.Next()) != NULL)
|
||||
|
@ -3289,7 +3289,7 @@ void AM_Drawer (FLevelLocals *Level, int bottom)
|
|||
AM_drawWalls(Level, allmap);
|
||||
AM_drawPlayers();
|
||||
if (G_SkillProperty(SKILLP_EasyKey))
|
||||
AM_drawKeys();
|
||||
AM_drawKeys(Level);
|
||||
if ((am_cheat >= 2 && am_cheat != 4) || allthings)
|
||||
AM_drawThings(Level);
|
||||
|
||||
|
|
|
@ -289,7 +289,7 @@ void DBot::ThinkForMove (ticcmd_t *cmd)
|
|||
r = pr_botmove();
|
||||
if (r < 128)
|
||||
{
|
||||
TThinkerIterator<AActor> it (NAME_Inventory, MAX_STATNUM+1, bglobal.firstthing);
|
||||
TThinkerIterator<AActor> it (player->mo->Level, NAME_Inventory, MAX_STATNUM+1, bglobal.firstthing);
|
||||
auto item = it.Next();
|
||||
|
||||
if (item != NULL || (item = it.Next()) != NULL)
|
||||
|
|
|
@ -919,13 +919,14 @@ static bool IsActor(AActor *mo)
|
|||
}
|
||||
|
||||
// [SP] modified - now allows showing count only, new arg must be passed. Also now still counts regardless, if lists are printed.
|
||||
static void PrintFilteredActorList(const ActorTypeChecker IsActorType, const char *FilterName, bool countOnly)
|
||||
static void PrintFilteredActorList(FLevelLocals *Level, const ActorTypeChecker IsActorType, const char *FilterName, bool countOnly)
|
||||
{
|
||||
AActor *mo;
|
||||
const PClass *FilterClass = NULL;
|
||||
int counter = 0;
|
||||
int tid = 0;
|
||||
|
||||
Printf("%s:\n", Level->MapName.GetChars());
|
||||
if (FilterName != NULL)
|
||||
{
|
||||
FilterClass = PClass::FindActor(FilterName);
|
||||
|
@ -940,7 +941,7 @@ static void PrintFilteredActorList(const ActorTypeChecker IsActorType, const cha
|
|||
}
|
||||
}
|
||||
}
|
||||
TThinkerIterator<AActor> it;
|
||||
TThinkerIterator<AActor> it(Level);
|
||||
|
||||
while ( (mo = it.Next()) )
|
||||
{
|
||||
|
@ -972,14 +973,20 @@ CCMD(actorlist) // [SP] print all actors (this can get quite big?)
|
|||
{
|
||||
if (CheckCheatmode ()) return;
|
||||
|
||||
PrintFilteredActorList(IsActor, argv.argc() > 1 ? argv[1] : NULL, false);
|
||||
ForAllLevels([&](FLevelLocals *Level)
|
||||
{
|
||||
PrintFilteredActorList(Level, IsActor, argv.argc() > 1 ? argv[1] : NULL, false);
|
||||
});
|
||||
}
|
||||
|
||||
CCMD(actornum) // [SP] count all actors
|
||||
{
|
||||
if (CheckCheatmode ()) return;
|
||||
|
||||
PrintFilteredActorList(IsActor, argv.argc() > 1 ? argv[1] : NULL, true);
|
||||
ForAllLevels([&](FLevelLocals *Level)
|
||||
{
|
||||
PrintFilteredActorList(Level, IsActor, argv.argc() > 1 ? argv[1] : NULL, true);
|
||||
});
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -991,14 +998,20 @@ CCMD(monster)
|
|||
{
|
||||
if (CheckCheatmode ()) return;
|
||||
|
||||
PrintFilteredActorList(IsActorAMonster, argv.argc() > 1 ? argv[1] : NULL, false);
|
||||
ForAllLevels([&](FLevelLocals *Level)
|
||||
{
|
||||
PrintFilteredActorList(Level, IsActorAMonster, argv.argc() > 1 ? argv[1] : NULL, false);
|
||||
});
|
||||
}
|
||||
|
||||
CCMD(monsternum) // [SP] count monsters
|
||||
{
|
||||
if (CheckCheatmode ()) return;
|
||||
|
||||
PrintFilteredActorList(IsActorAMonster, argv.argc() > 1 ? argv[1] : NULL, true);
|
||||
ForAllLevels([&](FLevelLocals *Level)
|
||||
{
|
||||
PrintFilteredActorList(Level, IsActorAMonster, argv.argc() > 1 ? argv[1] : NULL, true);
|
||||
});
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -1010,14 +1023,20 @@ CCMD(items)
|
|||
{
|
||||
if (CheckCheatmode ()) return;
|
||||
|
||||
PrintFilteredActorList(IsActorAnItem, argv.argc() > 1 ? argv[1] : NULL, false);
|
||||
ForAllLevels([&](FLevelLocals *Level)
|
||||
{
|
||||
PrintFilteredActorList(Level, IsActorAnItem, argv.argc() > 1 ? argv[1] : NULL, false);
|
||||
});
|
||||
}
|
||||
|
||||
CCMD(itemsnum) // [SP] # of any items
|
||||
{
|
||||
if (CheckCheatmode ()) return;
|
||||
|
||||
PrintFilteredActorList(IsActorAnItem, argv.argc() > 1 ? argv[1] : NULL, true);
|
||||
ForAllLevels([&](FLevelLocals *Level)
|
||||
{
|
||||
PrintFilteredActorList(Level, IsActorAnItem, argv.argc() > 1 ? argv[1] : NULL, true);
|
||||
});
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -1029,14 +1048,20 @@ CCMD(countitems)
|
|||
{
|
||||
if (CheckCheatmode ()) return;
|
||||
|
||||
PrintFilteredActorList(IsActorACountItem, argv.argc() > 1 ? argv[1] : NULL, false);
|
||||
ForAllLevels([&](FLevelLocals *Level)
|
||||
{
|
||||
PrintFilteredActorList(Level, IsActorACountItem, argv.argc() > 1 ? argv[1] : NULL, false);
|
||||
});
|
||||
}
|
||||
|
||||
CCMD(countitemsnum) // [SP] # of counted items
|
||||
{
|
||||
if (CheckCheatmode ()) return;
|
||||
|
||||
PrintFilteredActorList(IsActorACountItem, argv.argc() > 1 ? argv[1] : NULL, true);
|
||||
ForAllLevels([&](FLevelLocals *Level)
|
||||
{
|
||||
PrintFilteredActorList(Level, IsActorACountItem, argv.argc() > 1 ? argv[1] : NULL, true);
|
||||
});
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
@ -2085,12 +2085,12 @@ static int KillAll(PClassActor *cls)
|
|||
return P_Massacre(false, cls);
|
||||
}
|
||||
|
||||
static int RemoveClass(const PClass *cls)
|
||||
static int RemoveClass(FLevelLocals *Level, const PClass *cls)
|
||||
{
|
||||
AActor *actor;
|
||||
int removecount = 0;
|
||||
bool player = false;
|
||||
TThinkerIterator<AActor> iterator(cls);
|
||||
TThinkerIterator<AActor> iterator(Level, cls);
|
||||
while ((actor = iterator.Next()))
|
||||
{
|
||||
if (actor->IsA(cls))
|
||||
|
@ -2589,11 +2589,11 @@ void Net_DoCommand (int type, uint8_t **stream, int player)
|
|||
PClassActor *cls = PClass::FindActor(s);
|
||||
if (cls != NULL && cls->IsDescendantOf(RUNTIME_CLASS(AActor)))
|
||||
{
|
||||
removecount = RemoveClass(cls);
|
||||
removecount = RemoveClass(players[player].mo->Level, cls);
|
||||
const PClass *cls_rep = cls->GetReplacement();
|
||||
if (cls != cls_rep)
|
||||
{
|
||||
removecount += RemoveClass(cls_rep);
|
||||
removecount += RemoveClass(players[player].mo->Level, cls_rep);
|
||||
}
|
||||
Printf("Removed %d actors of type %s.\n", removecount, s);
|
||||
}
|
||||
|
|
|
@ -878,7 +878,7 @@ size_t DThinker::PropagateMark()
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
FThinkerIterator::FThinkerIterator (const PClass *type, int statnum)
|
||||
FThinkerIterator::FThinkerIterator (FLevelLocals *Level, const PClass *type, int statnum)
|
||||
{
|
||||
if ((unsigned)statnum > MAX_STATNUM)
|
||||
{
|
||||
|
@ -901,7 +901,7 @@ FThinkerIterator::FThinkerIterator (const PClass *type, int statnum)
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
FThinkerIterator::FThinkerIterator (const PClass *type, int statnum, DThinker *prev)
|
||||
FThinkerIterator::FThinkerIterator (FLevelLocals *Level, const PClass *type, int statnum, DThinker *prev)
|
||||
{
|
||||
if ((unsigned)statnum > MAX_STATNUM)
|
||||
{
|
||||
|
|
|
@ -128,10 +128,11 @@ private:
|
|||
uint8_t m_Stat;
|
||||
bool m_SearchStats;
|
||||
bool m_SearchingFresh;
|
||||
FLevelLocals *Level;
|
||||
|
||||
public:
|
||||
FThinkerIterator (const PClass *type, int statnum=MAX_STATNUM+1);
|
||||
FThinkerIterator (const PClass *type, int statnum, DThinker *prev);
|
||||
FThinkerIterator (FLevelLocals *Level, const PClass *type, int statnum=MAX_STATNUM+1);
|
||||
FThinkerIterator (FLevelLocals *Level, const PClass *type, int statnum, DThinker *prev);
|
||||
DThinker *Next (bool exact = false);
|
||||
void Reinit ();
|
||||
|
||||
|
@ -142,28 +143,28 @@ protected:
|
|||
template <class T> class TThinkerIterator : public FThinkerIterator
|
||||
{
|
||||
public:
|
||||
TThinkerIterator (int statnum=MAX_STATNUM+1) : FThinkerIterator (RUNTIME_CLASS(T), statnum)
|
||||
TThinkerIterator (FLevelLocals *Level, int statnum=MAX_STATNUM+1) : FThinkerIterator (Level, RUNTIME_CLASS(T), statnum)
|
||||
{
|
||||
}
|
||||
TThinkerIterator (int statnum, DThinker *prev) : FThinkerIterator (RUNTIME_CLASS(T), statnum, prev)
|
||||
TThinkerIterator (FLevelLocals *Level, int statnum, DThinker *prev) : FThinkerIterator (Level, RUNTIME_CLASS(T), statnum, prev)
|
||||
{
|
||||
}
|
||||
TThinkerIterator (const PClass *subclass, int statnum=MAX_STATNUM+1) : FThinkerIterator(subclass, statnum)
|
||||
TThinkerIterator (FLevelLocals *Level, const PClass *subclass, int statnum=MAX_STATNUM+1) : FThinkerIterator(Level, subclass, statnum)
|
||||
{
|
||||
}
|
||||
TThinkerIterator (FName subclass, int statnum=MAX_STATNUM+1) : FThinkerIterator(PClass::FindClass(subclass), statnum)
|
||||
TThinkerIterator (FLevelLocals *Level, FName subclass, int statnum=MAX_STATNUM+1) : FThinkerIterator(Level, PClass::FindClass(subclass), statnum)
|
||||
{
|
||||
}
|
||||
TThinkerIterator (ENamedName subclass, int statnum=MAX_STATNUM+1) : FThinkerIterator(PClass::FindClass(subclass), statnum)
|
||||
TThinkerIterator (FLevelLocals *Level, ENamedName subclass, int statnum=MAX_STATNUM+1) : FThinkerIterator(Level, PClass::FindClass(subclass), statnum)
|
||||
{
|
||||
}
|
||||
TThinkerIterator (FName subclass, int statnum, DThinker *prev) : FThinkerIterator(PClass::FindClass(subclass), statnum, prev)
|
||||
TThinkerIterator (FLevelLocals *Level, FName subclass, int statnum, DThinker *prev) : FThinkerIterator(Level, PClass::FindClass(subclass), statnum, prev)
|
||||
{
|
||||
}
|
||||
TThinkerIterator (ENamedName subclass, int statnum, DThinker *prev) : FThinkerIterator(PClass::FindClass(subclass), statnum, prev)
|
||||
TThinkerIterator (FLevelLocals *Level, ENamedName subclass, int statnum, DThinker *prev) : FThinkerIterator(Level, PClass::FindClass(subclass), statnum, prev)
|
||||
{
|
||||
}
|
||||
TThinkerIterator (const char *subclass, int statnum=MAX_STATNUM+1) : FThinkerIterator(PClass::FindClass(subclass), statnum)
|
||||
TThinkerIterator (FLevelLocals *Level, const char *subclass, int statnum=MAX_STATNUM+1) : FThinkerIterator(Level, PClass::FindClass(subclass), statnum)
|
||||
{
|
||||
}
|
||||
T *Next (bool exact = false)
|
||||
|
|
|
@ -712,7 +712,7 @@ static FWorldEvent E_SetupWorldEvent()
|
|||
{
|
||||
FWorldEvent e;
|
||||
e.IsSaveGame = savegamerestore;
|
||||
e.IsReopen = currentSession->Levelinfo[0]->FromSnapshot && !savegamerestore; // each one by itself isnt helpful, but with hub load we have savegamerestore==0 and level.FromSnapshot==1.
|
||||
e.IsReopen = currentSession->Levelinfo[0]->FromSnapshot && !savegamerestore; // each one by itself isnt helpful, but with hub load we have savegamerestore==0 and FromSnapshot==1.
|
||||
e.DamageAngle = 0.0;
|
||||
return e;
|
||||
}
|
||||
|
|
|
@ -2098,7 +2098,7 @@ void FParser::SF_LineTrigger()
|
|||
mld.special=intvalue(t_argv[0]);
|
||||
mld.tag=t_argc > 1 ? intvalue(t_argv[1]) : 0;
|
||||
P_TranslateLineDef(&line, &mld);
|
||||
P_ExecuteSpecial(line.special, NULL, Script->trigger, false,
|
||||
P_ExecuteSpecial(Level, line.special, NULL, Script->trigger, false,
|
||||
line.args[0],line.args[1],line.args[2],line.args[3],line.args[4]);
|
||||
}
|
||||
}
|
||||
|
@ -3645,7 +3645,7 @@ void FParser::SF_ThingCount(void)
|
|||
pClass = pClass->GetReplacement();
|
||||
|
||||
again:
|
||||
TThinkerIterator<AActor> it;
|
||||
TThinkerIterator<AActor> it(Level);
|
||||
|
||||
if (t_argc<2 || intvalue(t_argv[1])==0 || pClass->IsDescendantOf(NAME_Inventory))
|
||||
{
|
||||
|
@ -3786,7 +3786,7 @@ void FParser::SF_KillInSector()
|
|||
{
|
||||
if (CheckArgs(1))
|
||||
{
|
||||
TThinkerIterator<AActor> it;
|
||||
TThinkerIterator<AActor> it(Level);
|
||||
AActor * mo;
|
||||
int tag=intvalue(t_argv[0]);
|
||||
|
||||
|
@ -3848,7 +3848,7 @@ void FParser::RunLineSpecial(const FLineSpecial *spec)
|
|||
if (t_argc>i) args[i]=intvalue(t_argv[i]);
|
||||
else args[i] = 0;
|
||||
}
|
||||
t_return.value.i = P_ExecuteSpecial(spec->number, NULL,Script->trigger,false, args[0],args[1],args[2],args[3],args[4]);
|
||||
t_return.value.i = P_ExecuteSpecial(Level, spec->number, NULL,Script->trigger,false, args[0],args[1],args[2],args[3],args[4]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -339,7 +339,7 @@ void DFsScript::DryRunScript()
|
|||
char *rover = data;
|
||||
|
||||
// allocate space for the tokens
|
||||
FParser parse(&level, this);
|
||||
FParser parse(Level, this);
|
||||
try
|
||||
{
|
||||
while(rover < end && *rover)
|
||||
|
@ -429,7 +429,7 @@ void DFsScript::ParseInclude(char *lumpname)
|
|||
ProcessFindChar(lump, 0);
|
||||
|
||||
// now parse the lump
|
||||
FParser parse(&level, this);
|
||||
FParser parse(Level, this);
|
||||
parse.Run(lump, lump, lump+lumplen);
|
||||
|
||||
// free the lump
|
||||
|
|
|
@ -1103,7 +1103,7 @@ void G_Ticker ()
|
|||
uint32_t rngsum = FRandom::StaticSumSeeds ();
|
||||
|
||||
//Added by MC: For some of that bot stuff. The main bot function.
|
||||
bglobal.Main (&level);
|
||||
bglobal.Main (currentSession->Levelinfo[0]);
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
|
@ -1429,7 +1429,7 @@ static FPlayerStart *SelectRandomDeathmatchSpot (FLevelLocals *Level, int player
|
|||
DEFINE_ACTION_FUNCTION(DObject, G_PickDeathmatchStart)
|
||||
{
|
||||
PARAM_PROLOGUE;
|
||||
auto Level = &level;
|
||||
auto Level = currentSession->Levelinfo[0];
|
||||
unsigned int selections = Level->deathmatchstarts.Size();
|
||||
DVector3 pos;
|
||||
int angle;
|
||||
|
@ -1600,7 +1600,7 @@ static void G_QueueBody (AActor *body)
|
|||
EXTERN_CVAR(Bool, sv_singleplayerrespawn)
|
||||
void G_DoReborn (int playernum, bool freshbot)
|
||||
{
|
||||
auto Level = &level;
|
||||
auto Level = currentSession->Levelinfo[0];
|
||||
if (!multiplayer && !(Level->flags2 & LEVEL2_ALLOWRESPAWN) && !sv_singleplayerrespawn &&
|
||||
!G_SkillProperty(SKILLP_PlayerRespawn))
|
||||
{
|
||||
|
@ -2718,10 +2718,12 @@ void G_DoPlayDemo (void)
|
|||
{
|
||||
G_InitNew (mapname, false);
|
||||
}
|
||||
else if (level.sectors.Size() == 0)
|
||||
/*
|
||||
else if (!currentSession || currenlevel.sectors.Size() == 0)
|
||||
{
|
||||
I_Error("Cannot play demo without its savegame\n");
|
||||
}
|
||||
*/
|
||||
C_HideConsole ();
|
||||
demonew = false;
|
||||
precache = true;
|
||||
|
|
|
@ -387,7 +387,7 @@ void G_NewInit ()
|
|||
int i;
|
||||
|
||||
// Destory all old player refrences that may still exist
|
||||
TThinkerIterator<AActor> it(NAME_PlayerPawn, STAT_TRAVELLING);
|
||||
TThinkerIterator<AActor> it(currentSession->Levelinfo[0], NAME_PlayerPawn, STAT_TRAVELLING);
|
||||
AActor *pawn, *next;
|
||||
|
||||
next = it.Next();
|
||||
|
@ -1380,7 +1380,7 @@ void G_StartTravel ()
|
|||
|
||||
int G_FinishTravel ()
|
||||
{
|
||||
TThinkerIterator<AActor> it (NAME_PlayerPawn, STAT_TRAVELLING);
|
||||
TThinkerIterator<AActor> it (currentSession->Levelinfo[0], NAME_PlayerPawn, STAT_TRAVELLING);
|
||||
AActor *pawn, *pawndup, *oldpawn, *next;
|
||||
AActor *inv;
|
||||
FPlayerStart *start;
|
||||
|
@ -1744,7 +1744,7 @@ void G_UnSnapshotLevel (bool hubLoad)
|
|||
arc.SetLevel(nullptr);
|
||||
level.FromSnapshot = true;
|
||||
|
||||
TThinkerIterator<AActor> it(NAME_PlayerPawn);
|
||||
TThinkerIterator<AActor> it(currentSession->Levelinfo[0], NAME_PlayerPawn);
|
||||
AActor *pawn, *next;
|
||||
|
||||
next = it.Next();
|
||||
|
|
|
@ -54,8 +54,6 @@ struct SpreadInfo
|
|||
TArray<side_t *> SpreadStack;
|
||||
};
|
||||
|
||||
static int ImpactCount;
|
||||
|
||||
CVAR (Bool, cl_spreaddecals, true, CVAR_ARCHIVE)
|
||||
|
||||
IMPLEMENT_CLASS(DBaseDecal, false, true)
|
||||
|
@ -675,18 +673,24 @@ DBaseDecal *DImpactDecal::CloneSelf (const FDecalTemplate *tpl, double ix, doubl
|
|||
|
||||
CCMD (countdecals)
|
||||
{
|
||||
Printf ("%d impact decals\n", ImpactCount);
|
||||
ForAllLevels([](FLevelLocals *Level)
|
||||
{
|
||||
Printf("%d impact decals\n", Level->ImpactDecalCount);
|
||||
});
|
||||
}
|
||||
|
||||
CCMD (countdecalsreal)
|
||||
CCMD(countdecalsreal)
|
||||
{
|
||||
TThinkerIterator<DImpactDecal> iterator (STAT_AUTODECAL);
|
||||
int count = 0;
|
||||
ForAllLevels([](FLevelLocals *Level)
|
||||
{
|
||||
TThinkerIterator<DImpactDecal> iterator(Level, STAT_AUTODECAL);
|
||||
int count = 0;
|
||||
|
||||
while (iterator.Next())
|
||||
count++;
|
||||
while (iterator.Next())
|
||||
count++;
|
||||
|
||||
Printf ("Counted %d impact decals\n", count);
|
||||
Printf("Counted %d impact decals\n", count);
|
||||
});
|
||||
}
|
||||
|
||||
CCMD (spray)
|
||||
|
|
|
@ -835,13 +835,16 @@ void AActor::DeleteAttachedLights()
|
|||
|
||||
void AActor::DeleteAllAttachedLights()
|
||||
{
|
||||
TThinkerIterator<AActor> it;
|
||||
AActor * a;
|
||||
|
||||
while ((a=it.Next()))
|
||||
ForAllLevels([](FLevelLocals *Level)
|
||||
{
|
||||
a->DeleteAttachedLights();
|
||||
}
|
||||
TThinkerIterator<AActor> it(Level);
|
||||
AActor * a;
|
||||
|
||||
while ((a = it.Next()))
|
||||
{
|
||||
a->DeleteAttachedLights();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
@ -852,20 +855,23 @@ void AActor::DeleteAllAttachedLights()
|
|||
|
||||
void AActor::RecreateAllAttachedLights()
|
||||
{
|
||||
TThinkerIterator<AActor> it;
|
||||
AActor * a;
|
||||
|
||||
while ((a=it.Next()))
|
||||
ForAllLevels([](FLevelLocals *Level)
|
||||
{
|
||||
if (a->IsKindOf(NAME_DynamicLight))
|
||||
TThinkerIterator<AActor> it(Level);
|
||||
AActor * a;
|
||||
|
||||
while ((a = it.Next()))
|
||||
{
|
||||
::AttachLight(a);
|
||||
if (a->IsKindOf(NAME_DynamicLight))
|
||||
{
|
||||
::AttachLight(a);
|
||||
}
|
||||
else
|
||||
{
|
||||
a->SetDynamicLights();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
a->SetDynamicLights();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
@ -197,9 +197,9 @@ void DLightningThinker::ForceLightning (int mode)
|
|||
}
|
||||
}
|
||||
|
||||
static DLightningThinker *LocateLightning ()
|
||||
static DLightningThinker *LocateLightning (FLevelLocals *Level)
|
||||
{
|
||||
TThinkerIterator<DLightningThinker> iterator (STAT_LIGHTNING);
|
||||
TThinkerIterator<DLightningThinker> iterator (Level, STAT_LIGHTNING);
|
||||
return iterator.Next ();
|
||||
}
|
||||
|
||||
|
@ -231,16 +231,16 @@ void P_StartLightning (FLevelLocals *Level)
|
|||
}
|
||||
}
|
||||
|
||||
DLightningThinker *lightning = LocateLightning ();
|
||||
DLightningThinker *lightning = LocateLightning (Level);
|
||||
if (lightning == NULL)
|
||||
{
|
||||
Create<DLightningThinker>();
|
||||
}
|
||||
}
|
||||
|
||||
void P_ForceLightning (int mode)
|
||||
void P_ForceLightning (FLevelLocals *Level, int mode)
|
||||
{
|
||||
DLightningThinker *lightning = LocateLightning ();
|
||||
DLightningThinker *lightning = LocateLightning (Level);
|
||||
if (lightning == NULL)
|
||||
{
|
||||
lightning = Create<DLightningThinker>();
|
||||
|
|
|
@ -28,6 +28,6 @@ protected:
|
|||
};
|
||||
|
||||
void P_StartLightning (FLevelLocals *Level);
|
||||
void P_ForceLightning (int mode);
|
||||
void P_ForceLightning (FLevelLocals *Level, int mode);
|
||||
|
||||
#endif //__A_LIGHTNING_H__
|
||||
|
|
|
@ -300,7 +300,7 @@ int DEarthquake::StaticGetQuakeIntensities(double ticFrac, AActor *victim, FQuak
|
|||
return 0;
|
||||
}
|
||||
|
||||
TThinkerIterator<DEarthquake> iterator(STAT_EARTHQUAKE);
|
||||
TThinkerIterator<DEarthquake> iterator(victim->Level, STAT_EARTHQUAKE);
|
||||
DEarthquake *quake;
|
||||
int count = 0;
|
||||
|
||||
|
|
|
@ -3639,7 +3639,7 @@ do_count:
|
|||
}
|
||||
else
|
||||
{
|
||||
TThinkerIterator<AActor> iterator;
|
||||
TThinkerIterator<AActor> iterator(Level);
|
||||
while ( (actor = iterator.Next ()) )
|
||||
{
|
||||
if (actor->health > 0 &&
|
||||
|
@ -9364,7 +9364,7 @@ scriptwait:
|
|||
|
||||
case PCD_CANCELFADE:
|
||||
{
|
||||
TThinkerIterator<DFlashFader> iterator;
|
||||
TThinkerIterator<DFlashFader> iterator(Level);
|
||||
DFlashFader *fader;
|
||||
|
||||
while ( (fader = iterator.Next()) )
|
||||
|
|
|
@ -2663,7 +2663,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_RaiseChildren)
|
|||
PARAM_SELF_PROLOGUE(AActor);
|
||||
PARAM_INT(flags);
|
||||
|
||||
TThinkerIterator<AActor> it;
|
||||
TThinkerIterator<AActor> it(self->Level);
|
||||
AActor *mo;
|
||||
|
||||
while ((mo = it.Next()) != NULL)
|
||||
|
@ -2686,7 +2686,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_RaiseSiblings)
|
|||
PARAM_SELF_PROLOGUE(AActor);
|
||||
PARAM_INT(flags);
|
||||
|
||||
TThinkerIterator<AActor> it;
|
||||
TThinkerIterator<AActor> it(self->Level);
|
||||
AActor *mo;
|
||||
|
||||
if (self->master != NULL)
|
||||
|
@ -3288,7 +3288,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LineEffect)
|
|||
{
|
||||
oldjunk.tag = tag; // Sector tag for linedef
|
||||
P_TranslateLineDef(&junk, &oldjunk); // Turn into native type
|
||||
res = !!P_ExecuteSpecial(junk.special, NULL, self, false, junk.args[0],
|
||||
res = !!P_ExecuteSpecial(self->Level, junk.special, NULL, self, false, junk.args[0],
|
||||
junk.args[1], junk.args[2], junk.args[3], junk.args[4]);
|
||||
if (res && !(junk.flags & ML_REPEAT_SPECIAL)) // If only once,
|
||||
self->flags6 |= MF6_LINEDONE; // no more for this thing
|
||||
|
@ -3696,7 +3696,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_RadiusGive)
|
|||
int given = 0;
|
||||
if (flags & RGF_MISSILES)
|
||||
{
|
||||
TThinkerIterator<AActor> it;
|
||||
TThinkerIterator<AActor> it(self->Level);
|
||||
while ((thing = it.Next()) && ((unlimited) || (given < limit)))
|
||||
{
|
||||
given += DoRadiusGive(self, thing, item, amount, distance, flags, filter, species, mindist);
|
||||
|
@ -3925,7 +3925,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_DamageChildren)
|
|||
AActor *source = COPY_AAPTR(self, src);
|
||||
AActor *inflictor = COPY_AAPTR(self, inflict);
|
||||
|
||||
TThinkerIterator<AActor> it;
|
||||
TThinkerIterator<AActor> it(self->Level);
|
||||
AActor *mo;
|
||||
|
||||
while ( (mo = it.Next()) )
|
||||
|
@ -3955,7 +3955,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_DamageSiblings)
|
|||
AActor *source = COPY_AAPTR(self, src);
|
||||
AActor *inflictor = COPY_AAPTR(self, inflict);
|
||||
|
||||
TThinkerIterator<AActor> it;
|
||||
TThinkerIterator<AActor> it(self->Level);
|
||||
AActor *mo;
|
||||
|
||||
if (self->master != NULL)
|
||||
|
@ -4106,7 +4106,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_KillChildren)
|
|||
AActor *source = COPY_AAPTR(self, src);
|
||||
AActor *inflictor = COPY_AAPTR(self, inflict);
|
||||
|
||||
TThinkerIterator<AActor> it;
|
||||
TThinkerIterator<AActor> it(self->Level);
|
||||
AActor *mo;
|
||||
|
||||
while ( (mo = it.Next()) )
|
||||
|
@ -4137,7 +4137,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_KillSiblings)
|
|||
AActor *source = COPY_AAPTR(self, src);
|
||||
AActor *inflictor = COPY_AAPTR(self, inflict);
|
||||
|
||||
TThinkerIterator<AActor> it;
|
||||
TThinkerIterator<AActor> it(self->Level);
|
||||
AActor *mo;
|
||||
|
||||
if (self->master != NULL)
|
||||
|
@ -4265,7 +4265,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_RemoveChildren)
|
|||
PARAM_CLASS(filter, AActor);
|
||||
PARAM_NAME(species);
|
||||
|
||||
TThinkerIterator<AActor> it;
|
||||
TThinkerIterator<AActor> it(self->Level);
|
||||
AActor *mo;
|
||||
|
||||
while ((mo = it.Next()) != NULL)
|
||||
|
@ -4291,7 +4291,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_RemoveSiblings)
|
|||
PARAM_CLASS(filter, AActor);
|
||||
PARAM_NAME(species);
|
||||
|
||||
TThinkerIterator<AActor> it;
|
||||
TThinkerIterator<AActor> it(self->Level);
|
||||
AActor *mo;
|
||||
|
||||
if (self->master != NULL)
|
||||
|
|
|
@ -539,7 +539,7 @@ bool EV_DoCeiling (FLevelLocals *Level, DCeiling::ECeiling type, line_t *line,
|
|||
void P_ActivateInStasisCeiling (FLevelLocals *Level, int tag)
|
||||
{
|
||||
DCeiling *scan;
|
||||
TThinkerIterator<DCeiling> iterator;
|
||||
TThinkerIterator<DCeiling> iterator(Level);
|
||||
|
||||
while ( (scan = iterator.Next ()) )
|
||||
{
|
||||
|
@ -563,7 +563,7 @@ bool EV_CeilingCrushStop (FLevelLocals *Level, int tag, bool remove)
|
|||
{
|
||||
bool rtn = false;
|
||||
DCeiling *scan;
|
||||
TThinkerIterator<DCeiling> iterator;
|
||||
TThinkerIterator<DCeiling> iterator(Level);
|
||||
|
||||
scan = iterator.Next();
|
||||
while (scan != nullptr)
|
||||
|
|
|
@ -326,7 +326,7 @@ void P_RunEffects (FLevelLocals *Level)
|
|||
int pnum = players[consoleplayer].camera->Sector->Index() * Level->sectors.Size();
|
||||
|
||||
AActor *actor;
|
||||
TThinkerIterator<AActor> iterator;
|
||||
TThinkerIterator<AActor> iterator(Level);
|
||||
|
||||
while ( (actor = iterator.Next ()) )
|
||||
{
|
||||
|
|
|
@ -1201,7 +1201,7 @@ int P_LookForMonsters (AActor *actor)
|
|||
{
|
||||
int count;
|
||||
AActor *mo;
|
||||
TThinkerIterator<AActor> iterator;
|
||||
TThinkerIterator<AActor> iterator(actor->Level);
|
||||
|
||||
if (!P_CheckSight (players[0].mo, actor, SF_SEEPASTBLOCKEVERYTHING))
|
||||
{ // Player can't see monster
|
||||
|
@ -2389,7 +2389,7 @@ void A_DoChase (AActor *actor, bool fastchase, FState *meleestate, FState *missi
|
|||
// as the goal.
|
||||
while ( (spec = specit.Next()) )
|
||||
{
|
||||
P_ExecuteSpecial(spec->special, NULL, actor, false, spec->args[0],
|
||||
P_ExecuteSpecial(actor->Level, spec->special, NULL, actor, false, spec->args[0],
|
||||
spec->args[1], spec->args[2], spec->args[3], spec->args[4]);
|
||||
}
|
||||
|
||||
|
@ -3053,7 +3053,7 @@ int CheckBossDeath (AActor *actor)
|
|||
return false; // no one left alive, so do not end game
|
||||
|
||||
// Make sure all bosses are dead
|
||||
TThinkerIterator<AActor> iterator;
|
||||
TThinkerIterator<AActor> iterator(actor->Level);
|
||||
AActor *other;
|
||||
|
||||
while ( (other = iterator.Next ()) )
|
||||
|
@ -3096,7 +3096,7 @@ void A_BossDeath(AActor *self)
|
|||
}
|
||||
checked = true;
|
||||
|
||||
P_ExecuteSpecial(sa->Action, NULL, self, false,
|
||||
P_ExecuteSpecial(self->Level, sa->Action, NULL, self, false,
|
||||
sa->Args[0], sa->Args[1], sa->Args[2], sa->Args[3], sa->Args[4]);
|
||||
}
|
||||
}
|
||||
|
@ -3192,16 +3192,19 @@ int P_Massacre (bool baddies, PClassActor *cls)
|
|||
// fixed lost soul bug (LSs left behind when PEs are killed)
|
||||
|
||||
int killcount = 0;
|
||||
AActor *actor;
|
||||
TThinkerIterator<AActor> iterator(cls? cls : RUNTIME_CLASS(AActor));
|
||||
|
||||
while ( (actor = iterator.Next ()) )
|
||||
ForAllLevels([&](FLevelLocals *Level)
|
||||
{
|
||||
if (!(actor->flags2 & MF2_DORMANT) && (actor->flags3 & MF3_ISMONSTER) && (!baddies || !(actor->flags & MF_FRIENDLY)))
|
||||
AActor *actor;
|
||||
TThinkerIterator<AActor> iterator(Level, cls ? cls : RUNTIME_CLASS(AActor));
|
||||
|
||||
while ((actor = iterator.Next()))
|
||||
{
|
||||
killcount += actor->Massacre();
|
||||
if (!(actor->flags2 & MF2_DORMANT) && (actor->flags3 & MF3_ISMONSTER) && (!baddies || !(actor->flags & MF_FRIENDLY)))
|
||||
{
|
||||
killcount += actor->Massacre();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return killcount;
|
||||
}
|
||||
|
||||
|
|
|
@ -984,7 +984,7 @@ DPhased::DPhased (sector_t *sector, int baselevel, int phase)
|
|||
|
||||
void EV_StopLightEffect (FLevelLocals *Level, int tag)
|
||||
{
|
||||
TThinkerIterator<DLighting> iterator;
|
||||
TThinkerIterator<DLighting> iterator(Level);
|
||||
DLighting *effect;
|
||||
|
||||
while ((effect = iterator.Next()) != NULL)
|
||||
|
|
|
@ -1515,7 +1515,7 @@ FUNC(LS_Thing_Destroy)
|
|||
}
|
||||
else if (arg0 == 0)
|
||||
{
|
||||
TThinkerIterator<AActor> iterator;
|
||||
TThinkerIterator<AActor> iterator(Level);
|
||||
|
||||
actor = iterator.Next ();
|
||||
while (actor)
|
||||
|
@ -2070,7 +2070,7 @@ FUNC(LS_Elevator_LowerToNearest)
|
|||
FUNC(LS_Light_ForceLightning)
|
||||
// Light_ForceLightning (mode)
|
||||
{
|
||||
P_ForceLightning (arg0);
|
||||
P_ForceLightning (Level, arg0);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -6836,7 +6836,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 && Level->flags & LEVEL_ACTOWNSPECIAL && !(thing->activationtype & THINGSPEC_TriggerActs))
|
||||
|| (thing->activationtype & THINGSPEC_ThingActs)) // Who triggers?
|
||||
|
|
|
@ -5153,7 +5153,7 @@ AActor *P_SpawnPlayer (FLevelLocals *Level, FPlayerStart *mthing, int playernum,
|
|||
// monsters who last targeted this player will wake up immediately
|
||||
// after the player has respawned.
|
||||
AActor *th;
|
||||
TThinkerIterator<AActor> it;
|
||||
TThinkerIterator<AActor> it(Level);
|
||||
while ((th = it.Next()))
|
||||
{
|
||||
if (th->LastHeard == oldactor) th->LastHeard = nullptr;
|
||||
|
|
|
@ -403,7 +403,7 @@ void DPlat::Reactivate ()
|
|||
void P_ActivateInStasis (FLevelLocals *Level, int tag)
|
||||
{
|
||||
DPlat *scan;
|
||||
TThinkerIterator<DPlat> iterator;
|
||||
TThinkerIterator<DPlat> iterator(Level);
|
||||
|
||||
while ( (scan = iterator.Next ()) )
|
||||
{
|
||||
|
@ -421,7 +421,7 @@ void DPlat::Stop ()
|
|||
void EV_StopPlat (FLevelLocals *Level, int tag, bool remove)
|
||||
{
|
||||
DPlat *scan;
|
||||
TThinkerIterator<DPlat> iterator;
|
||||
TThinkerIterator<DPlat> iterator(Level);
|
||||
|
||||
scan = iterator.Next();
|
||||
while (scan != nullptr)
|
||||
|
|
|
@ -422,7 +422,7 @@ void AdjustPusher (FLevelLocals *Level, int tag, int magnitude, int angle, bool
|
|||
// Find pushers already attached to the sector, and change their parameters.
|
||||
TArray<FThinkerCollection> Collection;
|
||||
{
|
||||
TThinkerIterator<DPusher> iterator;
|
||||
TThinkerIterator<DPusher> iterator(Level);
|
||||
FThinkerCollection collect;
|
||||
|
||||
while ( (collect.Obj = iterator.Next ()) )
|
||||
|
|
|
@ -640,7 +640,7 @@ void SetWallScroller (FLevelLocals *Level, int id, int sidechoice, double dx, do
|
|||
if (dx == 0 && dy == 0)
|
||||
{
|
||||
// Special case: Remove the scroller, because the deltas are both 0.
|
||||
TThinkerIterator<DScroller> iterator (STAT_SCROLLER);
|
||||
TThinkerIterator<DScroller> iterator (Level, STAT_SCROLLER);
|
||||
DScroller *scroller;
|
||||
|
||||
while ( (scroller = iterator.Next ()) )
|
||||
|
@ -659,7 +659,7 @@ void SetWallScroller (FLevelLocals *Level, int id, int sidechoice, double dx, do
|
|||
// their rates.
|
||||
TArray<DScroller *> Collection;
|
||||
{
|
||||
TThinkerIterator<DScroller> iterator (STAT_SCROLLER);
|
||||
TThinkerIterator<DScroller> iterator (Level, STAT_SCROLLER);
|
||||
DScroller *scroll;
|
||||
|
||||
while ( (scroll = iterator.Next ()) )
|
||||
|
@ -698,7 +698,7 @@ void SetWallScroller (FLevelLocals *Level, int id, int sidechoice, double dx, do
|
|||
|
||||
void SetScroller (FLevelLocals *Level, int tag, EScroll type, double dx, double dy)
|
||||
{
|
||||
TThinkerIterator<DScroller> iterator (STAT_SCROLLER);
|
||||
TThinkerIterator<DScroller> iterator (Level, STAT_SCROLLER);
|
||||
DScroller *scroller;
|
||||
int i;
|
||||
|
||||
|
|
|
@ -138,7 +138,7 @@ static void PrecacheLevel(FLevelLocals *Level)
|
|||
memset(hitlist.Data(), 0, cnt);
|
||||
|
||||
AActor *actor;
|
||||
TThinkerIterator<AActor> iterator;
|
||||
TThinkerIterator<AActor> iterator(Level);
|
||||
|
||||
while ((actor = iterator.Next()))
|
||||
{
|
||||
|
@ -480,7 +480,7 @@ void P_SetupLevel(FLevelLocals *Level, const char *lumpname, int position, bool
|
|||
// Don't count monsters in end-of-level sectors if option is on
|
||||
if (dmflags2 & DF2_NOCOUNTENDMONST)
|
||||
{
|
||||
TThinkerIterator<AActor> it;
|
||||
TThinkerIterator<AActor> it(Level);
|
||||
AActor * mo;
|
||||
|
||||
while ((mo = it.Next()))
|
||||
|
|
|
@ -924,7 +924,7 @@ static void SetupCeilingPortal (AActor *point)
|
|||
|
||||
void P_SetupPortals(FLevelLocals *Level)
|
||||
{
|
||||
TThinkerIterator<AActor> it("StackPoint");
|
||||
TThinkerIterator<AActor> it(Level, "StackPoint");
|
||||
AActor *pt;
|
||||
TArray<AActor *> points;
|
||||
|
||||
|
@ -1306,7 +1306,7 @@ void P_SpawnSpecials (MapLoader *ml)
|
|||
P_SpawnFriction(Level); // phares 3/12/98: New friction model using linedefs
|
||||
P_SpawnPushers(Level); // phares 3/20/98: New pusher model using linedefs
|
||||
|
||||
TThinkerIterator<AActor> it2("SkyCamCompat");
|
||||
TThinkerIterator<AActor> it2(Level, "SkyCamCompat");
|
||||
AActor *pt2;
|
||||
while ((pt2 = it2.Next()))
|
||||
{
|
||||
|
|
|
@ -86,7 +86,7 @@ protected:
|
|||
static bool P_StartButton (side_t *side, int Where, FSwitchDef *Switch, const DVector2 &pos, bool useagain)
|
||||
{
|
||||
DActiveButton *button;
|
||||
TThinkerIterator<DActiveButton> iterator;
|
||||
TThinkerIterator<DActiveButton> iterator(side->sector->Level);
|
||||
|
||||
// See if button is already pressed
|
||||
while ( (button = iterator.Next ()) )
|
||||
|
|
|
@ -317,7 +317,7 @@ static AActor *SelectTeleDest (FLevelLocals *Level, int tid, int tag, bool noran
|
|||
// teleport destination. This means if 50 sectors have a matching tag and
|
||||
// only the last one has a destination, *every* actor is scanned at least 49
|
||||
// times. Yuck.
|
||||
TThinkerIterator<AActor> it2(NAME_TeleportDest);
|
||||
TThinkerIterator<AActor> it2(Level, NAME_TeleportDest);
|
||||
while ((searcher = it2.Next()) != NULL)
|
||||
{
|
||||
if (searcher->Sector == &Level->sectors[secnum])
|
||||
|
|
|
@ -754,7 +754,7 @@ int P_Thing_CheckProximity(AActor *self, PClass *classname, double distance, int
|
|||
const bool ptrWillChange = !!(flags & (CPXF_SETTARGET | CPXF_SETMASTER | CPXF_SETTRACER));
|
||||
const bool ptrDistPref = !!(flags & (CPXF_CLOSEST | CPXF_FARTHEST));
|
||||
|
||||
TThinkerIterator<AActor> it;
|
||||
TThinkerIterator<AActor> it(self->Level);
|
||||
AActor *mo, *dist = nullptr;
|
||||
|
||||
// [MC] Process of elimination, I think, will get through this as quickly and
|
||||
|
|
|
@ -117,7 +117,7 @@ void P_Ticker (void)
|
|||
}
|
||||
|
||||
// Reset all actor interpolations for all actors before the current thinking turn so that indirect actor movement gets properly interpolated.
|
||||
TThinkerIterator<AActor> it;
|
||||
TThinkerIterator<AActor> it(Level);
|
||||
AActor *ac;
|
||||
|
||||
while ((ac = it.Next()))
|
||||
|
|
|
@ -299,7 +299,7 @@ void P_TranslateLineDef (line_t *ld, maplinedef_t *mld, int lineindexforid)
|
|||
void FLevelLocals::TranslateTeleportThings ()
|
||||
{
|
||||
AActor *dest;
|
||||
TThinkerIterator<AActor> iterator(NAME_TeleportDest);
|
||||
TThinkerIterator<AActor> iterator(this, NAME_TeleportDest);
|
||||
bool foundSomething = false;
|
||||
|
||||
while ( (dest = iterator.Next()) )
|
||||
|
|
|
@ -1141,7 +1141,7 @@ void P_CreateLinkedPortals(FLevelLocals *Level)
|
|||
if (Level->linkedPortals.Size() > 0)
|
||||
{
|
||||
// We need to relink all actors that may touch a linked line portal
|
||||
TThinkerIterator<AActor> it;
|
||||
TThinkerIterator<AActor> it(Level);
|
||||
AActor *actor;
|
||||
while ((actor = it.Next()))
|
||||
{
|
||||
|
|
|
@ -488,7 +488,7 @@ void S_PrecacheLevel (TArray<int> &levelsounds)
|
|||
}
|
||||
|
||||
AActor *actor;
|
||||
TThinkerIterator<AActor> iterator;
|
||||
TThinkerIterator<AActor> iterator(SoundMainLevel);
|
||||
|
||||
// Precache all sounds known to be used by the currently spawned actors.
|
||||
while ( (actor = iterator.Next()) != NULL )
|
||||
|
|
|
@ -8624,7 +8624,7 @@ FxExpression *FxActionSpecialCall::Resolve(FCompileContext& ctx)
|
|||
|
||||
int BuiltinCallLineSpecial(int special, AActor *activator, int arg1, int arg2, int arg3, int arg4, int arg5)
|
||||
{
|
||||
return P_ExecuteSpecial(activator ? activator->Level : currentSession->LevelInfo[0], special, nullptr, activator, 0, arg1, arg2, arg3, arg4, arg5);
|
||||
return P_ExecuteSpecial(activator ? activator->Level : currentSession->Levelinfo[0], special, nullptr, activator, 0, arg1, arg2, arg3, arg4, arg5);
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION_NATIVE(DObject, BuiltinCallLineSpecial, BuiltinCallLineSpecial)
|
||||
|
|
|
@ -42,25 +42,25 @@ class DThinkerIterator : public DObject, public FThinkerIterator
|
|||
DECLARE_ABSTRACT_CLASS(DThinkerIterator, DObject)
|
||||
|
||||
public:
|
||||
DThinkerIterator(PClass *cls, int statnum = MAX_STATNUM + 1)
|
||||
: FThinkerIterator(cls, statnum)
|
||||
DThinkerIterator(FLevelLocals *Level, PClass *cls, int statnum = MAX_STATNUM + 1)
|
||||
: FThinkerIterator(Level, cls, statnum)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
IMPLEMENT_CLASS(DThinkerIterator, true, false);
|
||||
|
||||
static DThinkerIterator *CreateThinkerIterator(PClass *type, int statnum)
|
||||
static DThinkerIterator *CreateThinkerIterator(FLevelLocals *Level, PClass *type, int statnum)
|
||||
{
|
||||
return Create<DThinkerIterator>(type, statnum);
|
||||
return Create<DThinkerIterator>(Level, type, statnum);
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION_NATIVE(DThinkerIterator, Create, CreateThinkerIterator)
|
||||
DEFINE_ACTION_FUNCTION_NATIVE(FLevelLocals, CreateThinkerIterator, CreateThinkerIterator)
|
||||
{
|
||||
PARAM_PROLOGUE;
|
||||
PARAM_SELF_STRUCT_PROLOGUE(FLevelLocals);
|
||||
PARAM_CLASS(type, DThinker);
|
||||
PARAM_INT(statnum);
|
||||
ACTION_RETURN_OBJECT(Create<DThinkerIterator>(type, statnum));
|
||||
ACTION_RETURN_OBJECT(CreateThinkerIterator(self, type, statnum));
|
||||
}
|
||||
|
||||
static DThinker *NextThinker(DThinkerIterator *self, bool exact)
|
||||
|
|
|
@ -413,7 +413,7 @@ static void StoreLevelStats(FLevelLocals *Level)
|
|||
|
||||
// Check for living monsters. On some maps it can happen
|
||||
// that the counter misses some.
|
||||
TThinkerIterator<AActor> it;
|
||||
TThinkerIterator<AActor> it(Level);
|
||||
AActor *ac;
|
||||
int mc = 0;
|
||||
|
||||
|
|
|
@ -457,7 +457,7 @@ extend class Actor
|
|||
|
||||
int A_GiveToChildren(class<Inventory> itemtype, int amount = 0)
|
||||
{
|
||||
let it = ThinkerIterator.Create('Actor');
|
||||
let it = Level.CreateThinkerIterator('Actor');
|
||||
Actor mo;
|
||||
int count = 0;
|
||||
|
||||
|
@ -473,7 +473,7 @@ extend class Actor
|
|||
|
||||
int A_GiveToSiblings(class<Inventory> itemtype, int amount = 0)
|
||||
{
|
||||
let it = ThinkerIterator.Create('Actor');
|
||||
let it = Level.CreateThinkerIterator('Actor');
|
||||
Actor mo;
|
||||
int count = 0;
|
||||
|
||||
|
@ -528,7 +528,7 @@ extend class Actor
|
|||
|
||||
int A_TakeFromChildren(class<Inventory> itemtype, int amount = 0)
|
||||
{
|
||||
let it = ThinkerIterator.Create('Actor');
|
||||
let it = Level.CreateThinkerIterator('Actor');
|
||||
Actor mo;
|
||||
int count = 0;
|
||||
|
||||
|
@ -544,7 +544,7 @@ extend class Actor
|
|||
|
||||
int A_TakeFromSiblings(class<Inventory> itemtype, int amount = 0)
|
||||
{
|
||||
let it = ThinkerIterator.Create('Actor');
|
||||
let it = Level.CreateThinkerIterator('Actor');
|
||||
Actor mo;
|
||||
int count = 0;
|
||||
|
||||
|
|
|
@ -479,7 +479,10 @@ class Thinker : Object native play
|
|||
|
||||
class ThinkerIterator : Object native
|
||||
{
|
||||
native static ThinkerIterator Create(class<Object> type = "Actor", int statnum=Thinker.MAX_STATNUM+1);
|
||||
deprecated("3.8") static ThinkerIterator Create(class<Object> type = "Actor", int statnum=Thinker.MAX_STATNUM+1)
|
||||
{
|
||||
return currentSession.LevelInfo[0].CreateThinkerIterator(type, statnum);
|
||||
}
|
||||
native Thinker Next(bool exact = false);
|
||||
native void Reinit();
|
||||
}
|
||||
|
@ -758,6 +761,7 @@ struct LevelLocals native
|
|||
native SectorTagIterator CreateSectorTagIterator(int tag, line defline = null);
|
||||
native LineIdIterator CreateLineIdIterator(int tag);
|
||||
native ActorIterator CreateActorIterator(int tid, class<Actor> type = "Actor");
|
||||
native ThinkerIterator CreateThinkerIterator(class<Object> type = "Actor", int statnum=Thinker.MAX_STATNUM+1);
|
||||
|
||||
|
||||
String TimeFormatted(bool totals = false)
|
||||
|
|
|
@ -194,7 +194,7 @@ extend class Actor
|
|||
if (sv_killbossmonst)
|
||||
{
|
||||
int count; // Repeat until we have no more boss-spawned monsters.
|
||||
ThinkerIterator it = ThinkerIterator.Create("Actor");
|
||||
ThinkerIterator it = Level.CreateThinkerIterator("Actor");
|
||||
do // (e.g. Pain Elementals can spawn more to kill upon death.)
|
||||
{
|
||||
Actor mo;
|
||||
|
|
|
@ -64,7 +64,7 @@ extend class Actor
|
|||
A_NoBlocking(false);
|
||||
|
||||
// scan the remaining thinkers to see if all Keens are dead
|
||||
ThinkerIterator it = ThinkerIterator.Create(GetClass());
|
||||
ThinkerIterator it = Level.CreateThinkerIterator(GetClass());
|
||||
Actor mo;
|
||||
while (mo = Actor(it.Next(true)))
|
||||
{
|
||||
|
|
|
@ -96,7 +96,7 @@ extend class Actor
|
|||
// count total number of skulls currently on the level
|
||||
// if there are already 21 skulls on the level, don't spit another one
|
||||
int count = limit;
|
||||
ThinkerIterator it = ThinkerIterator.Create(spawntype);
|
||||
ThinkerIterator it = Level.CreateThinkerIterator(spawntype);
|
||||
Thinker othink;
|
||||
|
||||
while ( (othink = it.Next ()) )
|
||||
|
|
|
@ -119,7 +119,7 @@ extend class Actor
|
|||
{
|
||||
SoundAlert (self);
|
||||
}
|
||||
ThinkerIterator it = ThinkerIterator.Create("Actor");
|
||||
ThinkerIterator it = Level.CreateThinkerIterator("Actor");
|
||||
Actor mo;
|
||||
while ( (mo = Actor(it.Next ())) )
|
||||
{
|
||||
|
|
|
@ -472,7 +472,7 @@ class Minotaur : Actor
|
|||
|
||||
if (!target) // Normal monster search
|
||||
{
|
||||
ThinkerIterator it = ThinkerIterator.Create("Actor");
|
||||
ThinkerIterator it = Level.CreateThinkerIterator("Actor");
|
||||
|
||||
while ((mo = Actor(it.Next())) != null)
|
||||
{
|
||||
|
@ -619,7 +619,7 @@ class MinotaurFriend : Minotaur
|
|||
if (tracer && tracer.health > 0 && tracer.player)
|
||||
{
|
||||
// Search thinker list for minotaur
|
||||
ThinkerIterator it = ThinkerIterator.Create("MinotaurFriend");
|
||||
ThinkerIterator it = Level.CreateThinkerIterator("MinotaurFriend");
|
||||
MinotaurFriend mo;
|
||||
|
||||
while ((mo = MinotaurFriend(it.Next())) != null)
|
||||
|
|
|
@ -121,7 +121,7 @@ class CustomBridge : Actor
|
|||
// But this is not safe with custom bridge balls that do not necessarily call that function.
|
||||
// So the best course of action is to look for all bridge balls here and destroy them ourselves.
|
||||
|
||||
let it = ThinkerIterator.Create("Actor");
|
||||
let it = Level.CreateThinkerIterator("Actor");
|
||||
Actor thing;
|
||||
|
||||
while ((thing = Actor(it.Next())))
|
||||
|
|
|
@ -139,7 +139,7 @@ class SoundSequence : Actor
|
|||
if (slot != 'none')
|
||||
{ // This is a slotted sound, so add it to the master for that slot
|
||||
SoundSequenceSlot master;
|
||||
let locator = ThinkerIterator.Create("SoundSequenceSlot");
|
||||
let locator = Level.CreateThinkerIterator("SoundSequenceSlot");
|
||||
|
||||
while ((master = SoundSequenceSlot(locator.Next ())))
|
||||
{
|
||||
|
|
|
@ -116,7 +116,7 @@ class AlienSpectre1 : SpectralMonster
|
|||
{
|
||||
Console.MidPrint("SmallFont", "$TXT_KILLED_ORACLE");
|
||||
// If there are any Oracles still alive, kill them.
|
||||
ThinkerIterator it = ThinkerIterator.Create("Oracle");
|
||||
ThinkerIterator it = Level.CreateThinkerIterator("Oracle");
|
||||
Actor oracle;
|
||||
|
||||
while ( (oracle = Actor(it.Next())) != null)
|
||||
|
|
|
@ -36,7 +36,7 @@ class Oracle : Actor
|
|||
|
||||
void A_WakeOracleSpectre ()
|
||||
{
|
||||
ThinkerIterator it = ThinkerIterator.Create("AlienSpectre3");
|
||||
ThinkerIterator it = Level.CreateThinkerIterator("AlienSpectre3");
|
||||
Actor spectre = Actor(it.Next());
|
||||
|
||||
if (spectre != NULL && spectre.health > 0 && self.target != spectre)
|
||||
|
|
|
@ -612,7 +612,7 @@ class RaiseAlarm : DummyStrifeItem
|
|||
{
|
||||
toucher.SoundAlert (toucher);
|
||||
|
||||
ThinkerIterator it = ThinkerIterator.Create("AlienSpectre3");
|
||||
ThinkerIterator it = Level.CreateThinkerIterator("AlienSpectre3");
|
||||
Actor spectre = Actor(it.Next());
|
||||
|
||||
if (spectre != NULL && spectre.health > 0 && toucher != spectre)
|
||||
|
|
|
@ -160,7 +160,7 @@ class SVEOreSpawner : Actor
|
|||
}
|
||||
if(!inrange) return;
|
||||
|
||||
let it = ThinkerIterator.Create("DegninOre");
|
||||
let it = Level.CreateThinkerIterator("DegninOre");
|
||||
Thinker ac;
|
||||
|
||||
int numores = 0;
|
||||
|
|
Loading…
Reference in a new issue