diff --git a/src/server/NSOutput.qc b/src/server/NSOutput.qc index 56cde759..128280cf 100644 --- a/src/server/NSOutput.qc +++ b/src/server/NSOutput.qc @@ -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 diff --git a/src/shared/NSIO.h b/src/shared/NSIO.h index 434b6cff..8ebbb2ef 100644 --- a/src/shared/NSIO.h +++ b/src/shared/NSIO.h @@ -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); diff --git a/src/shared/NSIO.qc b/src/shared/NSIO.qc index badd15f3..f7924c25 100644 --- a/src/shared/NSIO.qc +++ b/src/shared/NSIO.qc @@ -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) {