Merge commit '2719ce86dc' into scripting
Conflicts: src/info.h src/thingdef/thingdef_codeptr.cpp (until right before the main work for multiple tags.)
This commit is contained in:
commit
8447990889
93 changed files with 1857 additions and 1565 deletions
|
|
@ -1341,7 +1341,7 @@ DPlaneWatcher::DPlaneWatcher (AActor *it, line_t *line, int lineSide, bool ceili
|
|||
{
|
||||
int secnum;
|
||||
|
||||
secnum = P_FindSectorFromTag (tag, -1);
|
||||
secnum = P_FindFirstSectorFromTag (tag);
|
||||
if (secnum >= 0)
|
||||
{
|
||||
secplane_t plane;
|
||||
|
|
@ -1409,12 +1409,6 @@ void DPlaneWatcher::Tick ()
|
|||
// own behavior is loaded (if it has one).
|
||||
void FBehavior::StaticLoadDefaultModules ()
|
||||
{
|
||||
// When playing Strife, STRFHELP is always loaded.
|
||||
if (gameinfo.gametype == GAME_Strife)
|
||||
{
|
||||
StaticLoadModule (Wads.CheckNumForName ("STRFHELP", ns_acslibrary));
|
||||
}
|
||||
|
||||
// Scan each LOADACS lump and load the specified modules in order
|
||||
int lump, lastlump = 0;
|
||||
|
||||
|
|
@ -3216,7 +3210,7 @@ do_count:
|
|||
if (actor->health > 0 &&
|
||||
(kind == NULL || actor->IsA (kind)))
|
||||
{
|
||||
if (actor->Sector->tag == tag || tag == -1)
|
||||
if (actor->Sector->HasTag(tag) || tag == -1)
|
||||
{
|
||||
// Don't count items in somebody's inventory
|
||||
if (!actor->IsKindOf (RUNTIME_CLASS(AInventory)) ||
|
||||
|
|
@ -3236,7 +3230,7 @@ do_count:
|
|||
if (actor->health > 0 &&
|
||||
(kind == NULL || actor->IsA (kind)))
|
||||
{
|
||||
if (actor->Sector->tag == tag || tag == -1)
|
||||
if (actor->Sector->HasTag(tag) || tag == -1)
|
||||
{
|
||||
// Don't count items in somebody's inventory
|
||||
if (!actor->IsKindOf (RUNTIME_CLASS(AInventory)) ||
|
||||
|
|
@ -3273,7 +3267,8 @@ void DLevelScript::ChangeFlat (int tag, int name, bool floorOrCeiling)
|
|||
|
||||
flat = TexMan.GetTexture (flatname, FTexture::TEX_Flat, FTextureManager::TEXMAN_Overridable);
|
||||
|
||||
while ((secnum = P_FindSectorFromTag (tag, secnum)) >= 0)
|
||||
FSectorTagIterator it(tag);
|
||||
while ((secnum = it.Next()) >= 0)
|
||||
{
|
||||
int pos = floorOrCeiling? sector_t::ceiling : sector_t::floor;
|
||||
sectors[secnum].SetTexture(pos, flat);
|
||||
|
|
@ -3304,7 +3299,8 @@ void DLevelScript::SetLineTexture (int lineid, int side, int position, int name)
|
|||
|
||||
texture = TexMan.GetTexture (texname, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable);
|
||||
|
||||
while ((linenum = P_FindLineFromID (lineid, linenum)) >= 0)
|
||||
FLineIdIterator itr(lineid);
|
||||
while ((linenum = itr.Next()) >= 0)
|
||||
{
|
||||
side_t *sidedef;
|
||||
|
||||
|
|
@ -4462,7 +4458,7 @@ int DLevelScript::SideFromID(int id, int side)
|
|||
}
|
||||
else
|
||||
{
|
||||
int line = P_FindLineFromID(id, -1);
|
||||
int line = P_FindFirstLineFromID(id);
|
||||
if (line == -1) return -1;
|
||||
if (lines[line].sidedef[side] == NULL) return -1;
|
||||
return lines[line].sidedef[side]->Index;
|
||||
|
|
@ -4478,7 +4474,7 @@ int DLevelScript::LineFromID(int id)
|
|||
}
|
||||
else
|
||||
{
|
||||
return P_FindLineFromID(id, -1);
|
||||
return P_FindFirstLineFromID(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -4837,10 +4833,10 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, SDWORD *args, const
|
|||
return 0; // Not implemented yet
|
||||
|
||||
case ACSF_GetSectorUDMFInt:
|
||||
return GetUDMFInt(UDMF_Sector, P_FindSectorFromTag(args[0], -1), FBehavior::StaticLookupString(args[1]));
|
||||
return GetUDMFInt(UDMF_Sector, P_FindFirstSectorFromTag(args[0]), FBehavior::StaticLookupString(args[1]));
|
||||
|
||||
case ACSF_GetSectorUDMFFixed:
|
||||
return GetUDMFFixed(UDMF_Sector, P_FindSectorFromTag(args[0], -1), FBehavior::StaticLookupString(args[1]));
|
||||
return GetUDMFFixed(UDMF_Sector, P_FindFirstSectorFromTag(args[0]), FBehavior::StaticLookupString(args[1]));
|
||||
|
||||
case ACSF_GetSideUDMFInt:
|
||||
return GetUDMFInt(UDMF_Side, SideFromID(args[0], args[1]), FBehavior::StaticLookupString(args[2]));
|
||||
|
|
@ -5167,11 +5163,11 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, SDWORD *args, const
|
|||
int space = args[2] < CHAN_FLOOR || args[2] > CHAN_INTERIOR ? CHAN_FULLHEIGHT : args[2];
|
||||
if (seqname != NULL)
|
||||
{
|
||||
int secnum = -1;
|
||||
|
||||
while ((secnum = P_FindSectorFromTag(args[0], secnum)) >= 0)
|
||||
FSectorTagIterator it(args[0]);
|
||||
int s;
|
||||
while ((s = it.Next()) >= 0)
|
||||
{
|
||||
SN_StartSequence(§ors[secnum], args[2], seqname, 0);
|
||||
SN_StartSequence(§ors[s], args[2], seqname, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -5690,9 +5686,9 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)
|
|||
case ACSF_SetLineActivation:
|
||||
if (argCount >= 2)
|
||||
{
|
||||
int line = -1;
|
||||
|
||||
while ((line = P_FindLineFromID(args[0], line)) >= 0)
|
||||
int line;
|
||||
FLineIdIterator itr(args[0]);
|
||||
while ((line = itr.Next()) >= 0)
|
||||
{
|
||||
lines[line].activation = args[1];
|
||||
}
|
||||
|
|
@ -5702,7 +5698,7 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)
|
|||
case ACSF_GetLineActivation:
|
||||
if (argCount > 0)
|
||||
{
|
||||
int line = P_FindLineFromID(args[0], -1);
|
||||
int line = P_FindFirstLineFromID(args[0]);
|
||||
return line >= 0 ? lines[line].activation : 0;
|
||||
}
|
||||
break;
|
||||
|
|
@ -5950,11 +5946,13 @@ int DLevelScript::RunScript ()
|
|||
// Wait for tagged sector(s) to go inactive, then enter
|
||||
// state running
|
||||
{
|
||||
int secnum = -1;
|
||||
|
||||
while ((secnum = P_FindSectorFromTag (statedata, secnum)) >= 0)
|
||||
int secnum;
|
||||
FSectorTagIterator it(statedata);
|
||||
while ((secnum = it.Next()) >= 0)
|
||||
{
|
||||
if (sectors[secnum].floordata || sectors[secnum].ceilingdata)
|
||||
return resultValue;
|
||||
}
|
||||
|
||||
// If we got here, none of the tagged sectors were busy
|
||||
state = SCRIPT_Running;
|
||||
|
|
@ -7994,9 +7992,10 @@ scriptwait:
|
|||
|
||||
case PCD_SETLINEBLOCKING:
|
||||
{
|
||||
int line = -1;
|
||||
int line;
|
||||
|
||||
while ((line = P_FindLineFromID (STACK(2), line)) >= 0)
|
||||
FLineIdIterator itr(STACK(2));
|
||||
while ((line = itr.Next()) >= 0)
|
||||
{
|
||||
switch (STACK(1))
|
||||
{
|
||||
|
|
@ -8029,9 +8028,10 @@ scriptwait:
|
|||
|
||||
case PCD_SETLINEMONSTERBLOCKING:
|
||||
{
|
||||
int line = -1;
|
||||
int line;
|
||||
|
||||
while ((line = P_FindLineFromID (STACK(2), line)) >= 0)
|
||||
FLineIdIterator itr(STACK(2));
|
||||
while ((line = itr.Next()) >= 0)
|
||||
{
|
||||
if (STACK(1))
|
||||
lines[line].flags |= ML_BLOCKMONSTERS;
|
||||
|
|
@ -8056,7 +8056,8 @@ scriptwait:
|
|||
arg0 = -FName(FBehavior::StaticLookupString(arg0));
|
||||
}
|
||||
|
||||
while ((linenum = P_FindLineFromID (STACK(7), linenum)) >= 0)
|
||||
FLineIdIterator itr(STACK(7));
|
||||
while ((linenum = itr.Next()) >= 0)
|
||||
{
|
||||
line_t *line = &lines[linenum];
|
||||
line->special = specnum;
|
||||
|
|
@ -8516,7 +8517,7 @@ scriptwait:
|
|||
fixed_t z = 0;
|
||||
|
||||
if (tag != 0)
|
||||
secnum = P_FindSectorFromTag (tag, -1);
|
||||
secnum = P_FindFirstSectorFromTag (tag);
|
||||
else
|
||||
secnum = int(P_PointInSector (x, y) - sectors);
|
||||
|
||||
|
|
@ -8538,7 +8539,7 @@ scriptwait:
|
|||
|
||||
case PCD_GETSECTORLIGHTLEVEL:
|
||||
{
|
||||
int secnum = P_FindSectorFromTag (STACK(1), -1);
|
||||
int secnum = P_FindFirstSectorFromTag (STACK(1));
|
||||
int z = -1;
|
||||
|
||||
if (secnum >= 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue