Copy first mapthing tag to their mobjs

Allows the ThingCount and ThingSound ACS functions to fully work now, and adds significantly more possibilities for scripting later.
This commit is contained in:
Sally Coolatta 2023-01-01 16:55:39 -05:00 committed by NepDisk
parent 5672fd6d50
commit 5dc56a413e

View file

@ -539,7 +539,6 @@ bool CallFunc_ThingCount(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::
mobjtype_t type = MT_NULL;
mtag_t tid = 0;
mtag_t sectorTag = 0;
size_t count = 0;
@ -568,21 +567,8 @@ bool CallFunc_ThingCount(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::
tid = argV[1];
if (argC > 2)
if (tid != 0)
{
sectorTag = argV[2];
}
if (sectorTag != 0)
{
// Search through sectors.
filter_for_mobjtype = type;
count = ACS_SectorTagThingCounter(sectorTag, nullptr, tid, ACS_ThingTypeFilter);
filter_for_mobjtype = MT_NULL;
}
else if (tid != 0)
{
// Search through tag lists.
mobj_t *mobj = nullptr;
while ((mobj = P_FindMobjFromTID(tid, mobj, nullptr)) != nullptr)