From efa0e5d0d6697612f3f08ff7d6068bd41b84630b Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Tue, 12 Jun 2012 18:46:24 +0100 Subject: TPT Fix infinite loop when trying to detach soap with extra ctype bits set eb0b2f9ca3 diff --git a/src/simulation/elements/SOAP.cpp b/src/simulation/elements/SOAP.cpp index f122c1f..f66334e 100644 --- a/src/simulation/elements/SOAP.cpp +++ b/src/simulation/elements/SOAP.cpp @@ -64,13 +64,13 @@ int Element_SOAP::update(UPDATE_FUNC_ARGS) { if (parts[i].life<=0) { - if ((parts[i].ctype&6) != 6 && parts[i].ctype>1) + if ((parts[i].ctype&6) != 6 && (parts[i].ctype&6)) { int target; target = i; - while((parts[target].ctype&6) != 6 && parts[target].ctype>1) + while((parts[target].ctype&6) != 6 && (parts[target].ctype&6)) { if ((parts[target].ctype&2) == 2) { @@ -282,4 +282,4 @@ int Element_SOAP::update(UPDATE_FUNC_ARGS) } -Element_SOAP::~Element_SOAP() {} \ No newline at end of file +Element_SOAP::~Element_SOAP() {} -- cgit v0.9.2-21-gd62e