- Added ACS function IsTIDUsed(tid): It returns whether any actors using the given TID exist. This
is more efficient than ThingCount(tid, T_NONE), because it only needs to check for one actor with the TID and not all of them. It also makes no distinction between dead things and live things like ThingCount does. - Added ACS function UniqueTID(tid, limit): It returns a new TID that is not currently used by any actors. It has two modes of operation. If tid is non-zero, then it checks TIDs one-by-one starting at the given tid until if finds a free one. If tid is zero, then it returns a completely random TID. If limit is non-zero, then it will only check that many times for a free TID, so it might not find a free one. If no free TID is found, 0 is returned. If limit is zero, then the search is effectively unlimited. SVN r3798 (trunk)
This commit is contained in:
parent
67f64081d0
commit
8c465df44e
3 changed files with 103 additions and 4 deletions
|
|
@ -3363,6 +3363,8 @@ enum EACSFunctions
|
|||
ACSF_ACS_NamedLockedExecuteDoor,
|
||||
ACSF_ACS_NamedExecuteWithResult,
|
||||
ACSF_ACS_NamedExecuteAlways,
|
||||
ACSF_UniqueTID,
|
||||
ACSF_IsTIDUsed,
|
||||
|
||||
// ZDaemon
|
||||
ACSF_GetTeamScore = 19620,
|
||||
|
|
@ -3879,6 +3881,14 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, SDWORD *args)
|
|||
}
|
||||
break;
|
||||
|
||||
case ACSF_UniqueTID:
|
||||
return P_FindUniqueTID(argCount > 0 ? args[0] : 0, argCount > 1 ? args[1] : 0);
|
||||
break;
|
||||
|
||||
case ACSF_IsTIDUsed:
|
||||
return P_IsTIDUsed(args[0]);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue