mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-18 01:52:34 +00:00
- added PinkSilver's ACS Checksight submission.
SVN r2532 (trunk)
This commit is contained in:
parent
564fb6a723
commit
09bd076b17
1 changed files with 49 additions and 0 deletions
|
@ -3033,6 +3033,7 @@ enum EACSFunctions
|
||||||
ACSF_SoundSequenceOnPolyobj,
|
ACSF_SoundSequenceOnPolyobj,
|
||||||
ACSF_GetPolyobjX,
|
ACSF_GetPolyobjX,
|
||||||
ACSF_GetPolyobjY,
|
ACSF_GetPolyobjY,
|
||||||
|
ACSF_CheckSight,
|
||||||
};
|
};
|
||||||
|
|
||||||
int DLevelScript::SideFromID(int id, int side)
|
int DLevelScript::SideFromID(int id, int side)
|
||||||
|
@ -3456,6 +3457,54 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, SDWORD *args)
|
||||||
}
|
}
|
||||||
return FIXED_MAX;
|
return FIXED_MAX;
|
||||||
|
|
||||||
|
case ACSF_CheckSight:
|
||||||
|
{
|
||||||
|
AActor *source;
|
||||||
|
AActor *dest;
|
||||||
|
|
||||||
|
int flags = SF_IGNOREVISIBILITY;
|
||||||
|
|
||||||
|
if (args[2] & 1) flags |= SF_IGNOREWATERBOUNDARY;
|
||||||
|
if (args[2] & 2) flags |= SF_SEEPASTBLOCKEVERYTHING | SF_SEEPASTSHOOTABLELINES;
|
||||||
|
|
||||||
|
if (args[0] == 0)
|
||||||
|
{
|
||||||
|
source = (AActor *) activator;
|
||||||
|
|
||||||
|
if (args[1] == 0) return 1; // [KS] I'm sure the activator can see itself.
|
||||||
|
|
||||||
|
TActorIterator<AActor> dstiter (args[1]);
|
||||||
|
|
||||||
|
while ( (dest = dstiter.Next ()) )
|
||||||
|
{
|
||||||
|
if (P_CheckSight(source, dest, flags)) return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TActorIterator<AActor> srciter (args[0]);
|
||||||
|
|
||||||
|
if (args[1] == 0) dest = (AActor *) activator;
|
||||||
|
|
||||||
|
while ( (source = srciter.Next ()) )
|
||||||
|
{
|
||||||
|
if (args[1] != 0)
|
||||||
|
{
|
||||||
|
TActorIterator<AActor> dstiter (args[1]);
|
||||||
|
while ( (dest = dstiter.Next ()) )
|
||||||
|
{
|
||||||
|
if (P_CheckSight(source, dest, flags)) return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (P_CheckSight(source, dest, flags)) return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue