separate problematic code to see where the segfault happens

This commit is contained in:
Mark Vejvoda 2013-09-21 00:11:34 +00:00
parent 30913d9ae1
commit 123a329baf
1 changed files with 6 additions and 4 deletions

View File

@ -2489,11 +2489,13 @@ void Unit::updateTimedParticles() {
UnitParticleSystem *ps = unitParticleSystems[i];
if(ps != NULL) {
if(Renderer::getInstance().validateParticleSystemStillExists(ps,rsGame) == true) {
if(truncateDecimal<float>(ps->getStartTime()) != 0.0 || truncateDecimal<float>(ps->getEndTime()) != 1.0) {
//printf("Checking for end particle system #%d [%d] [%f] [%f] [%f] [%f]\n",i,ps->shape,truncateDecimal<float>(ps->getStartTime()),truncateDecimal<float>(ps->getEndTime()),truncateDecimal<float>(animProgress),truncateDecimal<float>(lastAnimProgress));
float particleStartTime = truncateDecimal<float>(ps->getStartTime());
float particleEndTime = truncateDecimal<float>(ps->getEndTime());
if(truncateDecimal<float>(getAnimProgressAsFloat()) >= 0.99 ||
truncateDecimal<float>(getAnimProgressAsFloat()) >= truncateDecimal<float>(ps->getEndTime())) {
if(particleStartTime != 0.0 || particleEndTime != 1.0) {
//printf("Checking for end particle system #%d [%d] [%f] [%f] [%f] [%f]\n",i,ps->shape,truncateDecimal<float>(ps->getStartTime()),truncateDecimal<float>(ps->getEndTime()),truncateDecimal<float>(animProgress),truncateDecimal<float>(lastAnimProgress));
float animProgressTime = truncateDecimal<float>(getAnimProgressAsFloat());
if(animProgressTime >= 0.99 || animProgressTime >= particleEndTime) {
//printf("ENDING particle system [%d]\n",ps->shape);
ps->fade();