NSIO: new method CheckOutput(string), which will see if a given Output is ready to fire again.
This commit is contained in:
parent
9518a23f03
commit
5b52c57a56
3 changed files with 19 additions and 0 deletions
|
@ -29,6 +29,8 @@ NSOutput::TriggerOutput(void)
|
|||
/* we're not -1 (infinite) and we've still got one use to deduct */
|
||||
if (m_iCount > 0)
|
||||
m_iCount--;
|
||||
|
||||
nextthink = 0.0f;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -92,6 +92,10 @@ public:
|
|||
Input/Output specification. */
|
||||
nonvirtual string CreateOutput(string);
|
||||
|
||||
/** Returns whether the Output is ready, or has done firing - not currently scheduled to fire, etc.
|
||||
Input is the identifier of an output. */
|
||||
nonvirtual bool CheckOutput(string);
|
||||
|
||||
/* save game related methods */
|
||||
/** Saves a floating point key/value pair to a filehandle. */
|
||||
nonvirtual void SaveFloat(float,string,float);
|
||||
|
|
|
@ -164,6 +164,19 @@ NSIO::CreateOutput(string outmsg)
|
|||
return outname;
|
||||
}
|
||||
|
||||
bool
|
||||
NSIO::CheckOutput(string strOut)
|
||||
{
|
||||
for (entity f = world; (f = find(f, ::targetname, strOut));) {
|
||||
NSOutput op = (NSOutput)f;
|
||||
|
||||
if (op.nextthink != 0.0f)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
string
|
||||
NSIO::PrepareOutput(string strOut, string strValue)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue