Project

General

Profile

« Previous | Next » 

Revision 476bbc81

Added by Leszek Koltunski almost 8 years ago

Bugfix for removeByType

View differences:

src/main/java/org/distorted/library/EffectQueue.java
132 132
 
133 133
///////////////////////////////////////////////////////////////////////////////////////////////////
134 134

  
135
  synchronized boolean removeByID(long id)
135
  synchronized int removeByID(long id)
136 136
    {
137 137
    int i = getEffectIndex(id);
138 138
   
139 139
    if( i>=0 ) 
140 140
      {
141 141
      remove(i);
142
      return true;
142
      return 1;
143 143
      }
144 144
   
145
    return false; 
145
    return 0;
146 146
    }
147 147

  
148 148
///////////////////////////////////////////////////////////////////////////////////////////////////
149 149

  
150
  synchronized boolean removeByType(EffectNames effect)
150
  synchronized int removeByType(EffectNames effect)
151 151
    {
152
    boolean ret = false;  
152
    int ret = 0;
153 153
    int ord = effect.ordinal();  
154 154
     
155 155
    for(int i=0; i<mNumEffects; i++)
......
157 157
      if( mType[i]==ord )
158 158
        {
159 159
        remove(i);
160
        // TODO: don't we have to do a 'i--' here? Check this.
161
        ret = true;
160
        i--;
161
        ret++;
162 162
        }
163 163
      }
164 164
   

Also available in: Unified diff