Bugfixing pass
Bugfixing pass. Spawn swapovers. Broom!
This commit is contained in:
37
_module/nss/sparky_exit.nss
Normal file
37
_module/nss/sparky_exit.nss
Normal file
@@ -0,0 +1,37 @@
|
||||
/* Generic area onExit script for use with the Sparky Spawner scripting
|
||||
Created By: The Amethyst Dragon (www.amethyst-dragon.com/nwn)
|
||||
|
||||
Can be used for the onExit script for all areas of a module. If you already
|
||||
have your own area enter script, you can add just the include and the
|
||||
"Sparky Spawner" Sections of code (one function, one bit of code to execute).
|
||||
|
||||
This searches the area for remaining PCs, and if it doesn't find any, it
|
||||
despawns all the things in the area created by the Sparky spawner.
|
||||
*/
|
||||
|
||||
#include "sparky_inc"
|
||||
|
||||
//////////////////////////////////////////////// Sparky Spawner Section 1 of 2
|
||||
int CheckForPCs()
|
||||
{
|
||||
object oPC = GetFirstPC();
|
||||
while (oPC != OBJECT_INVALID)
|
||||
{
|
||||
if (GetArea(oPC) == OBJECT_SELF) { return TRUE; }
|
||||
oPC = GetNextPC();
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
//////////////////////////////////////////////// End Sparky Section 1 of 2
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
object oArea = OBJECT_SELF;
|
||||
|
||||
//////////////////////////////////////////////// Sparky Spawner Section 2 of 2
|
||||
if (CheckForPCs() == FALSE) { Despawn(oArea); }
|
||||
//////////////////////////////////////////////// End Sparky Section 2 of 2
|
||||
|
||||
}
|
Reference in New Issue
Block a user