From 2c77bc3ec554bf2f9cd534470f7628b5eaa29320 Mon Sep 17 00:00:00 2001 From: Sven Eberhardt Date: Sat, 25 Jul 2015 22:03:06 -0400 Subject: [PATCH] Fix null pointer exceptions for lonely mosquitoes that aren't part of a swarm. --- .../Libraries.ocd/Insect.ocd/InsectSwarm.ocd/Script.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/planet/Objects.ocd/Libraries.ocd/Insect.ocd/InsectSwarm.ocd/Script.c b/planet/Objects.ocd/Libraries.ocd/Insect.ocd/InsectSwarm.ocd/Script.c index a1b25d685..c52c785e4 100644 --- a/planet/Objects.ocd/Libraries.ocd/Insect.ocd/InsectSwarm.ocd/Script.c +++ b/planet/Objects.ocd/Libraries.ocd/Insect.ocd/InsectSwarm.ocd/Script.c @@ -98,7 +98,7 @@ private func Death() private func Destruction() { // Destruction of the master - if (lib_swarm_helper->GetMaster() == this) + 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) @@ -116,7 +116,7 @@ private func PurgeLine() private func MoveToTarget() { - if (lib_swarm_helper->GetMaster() == this) + if (!lib_swarm_helper || (lib_swarm_helper->GetMaster() == this)) return _inherited(); var coordinates = { x=0, y=0 };