Swarm library includes insect library. It's needed anyway.

lights3
Clonkonaut 2015-07-31 23:20:48 +02:00
parent ddd49f9b31
commit c7df46762d
1 changed files with 8 additions and 5 deletions

View File

@ -1,11 +1,12 @@
/**
Insect Swarm Library
Superimpose to any (flying) insect to create an insect swarm.
Always include after Library_Insect!
@author Clonkonaut
--*/
#include Library_Insect
// Places amount swarms with swarm_members individuals each
public func Place(int amount, int swarm_members, proplist area)
{
@ -83,8 +84,9 @@ private func Initialize()
private func Death()
{
// Death of the master
if (lib_swarm_helper->GetMaster() == this)
lib_swarm_helper->MakeNewMaster(lib_swarm_nextinline);
if (lib_swarm_helper)
if (lib_swarm_helper->GetMaster() == this)
lib_swarm_helper->MakeNewMaster(lib_swarm_nextinline);
// Death of a slave
if(lib_swarm_previnline && lib_swarm_nextinline)
{
@ -98,8 +100,9 @@ private func Death()
private func Destruction()
{
// Destruction of the master
if (lib_swarm_helper) if (lib_swarm_helper->GetMaster() == this)
lib_swarm_helper->MakeNewMaster(lib_swarm_nextinline);
if (lib_swarm_helper)
if (lib_swarm_helper->GetMaster() == this)
lib_swarm_helper->MakeNewMaster(lib_swarm_nextinline);
// Destruction of a slave
if(lib_swarm_previnline && lib_swarm_nextinline)
{