From: Andrew R. <aar...@us...> - 2005-11-22 04:35:13
|
Update of /cvsroot/planeshift/planeshift/src/common/effects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21218/src/common/effects Modified Files: pseffectmanager.cpp Log Message: - Fix to effects deleting themselves. Thanks to David Brodsky for pointing out the problem. Index: pseffectmanager.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/common/effects/pseffectmanager.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** pseffectmanager.cpp 26 Oct 2005 16:05:35 -0000 1.18 --- pseffectmanager.cpp 22 Nov 2005 04:34:57 -0000 1.19 *************** *** 311,314 **** --- 311,316 ---- { #ifndef DONT_DO_EFFECTS + unsigned int delId = (unsigned int)-1; + if (elapsed == 0) elapsed = vc->GetElapsedTicks(); *************** *** 324,333 **** // update the effect itself ! if (!effect->Update(elapsed)) { delete effect; ! actualEffects.DeleteAll(id); } } #endif } --- 326,338 ---- // update the effect itself ! if (!effect->Update(elapsed) && delId != (unsigned int )-1) { delete effect; ! delId = id; } } + + if (delId != (unsigned int)-1) + actualEffects.DeleteAll(delId); #endif } |