Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3586 in orxonox.OLD for orxonox/trunk/src/lib


Ignore:
Timestamp:
Mar 17, 2005, 2:15:33 AM (20 years ago)
Author:
patrick
Message:

orxonox/trunk: fixed movement bug (was in the lists), modified the player

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/util/list.h

    r3585 r3586  
    120120void tList<T>::add(T* entity)
    121121{
     122  if( entity == NULL) return;
    122123  listElement* el = new listElement;
    123124  el->prev = this->last;
     
    136137void tList<T>::remove(T* entity)
    137138{
     139  if( entity == NULL) return;
    138140  this->currentEl = this->first;
    139141  listElement* te;
     
    200202T* tList<T>::enumerate()
    201203{
    202   if(this->last == this->first) return NULL;
     204  //if( this->last == this->first == NULL) return NULL;
     205  if(this->size == 0) return NULL;
    203206  this->currentEl = this->first;
    204207  return this->currentEl->curr;
     
    209212T* tList<T>::nextElement()
    210213{
    211   if(this->last == this->first) return NULL;
     214  // if( this->last == this->first == NULL) return NULL;
     215  if(this->size == 0) return NULL;
    212216  this->currentEl = this->currentEl->next;
    213217  if(this->currentEl == NULL) return NULL;
     
    222226T* tList<T>::nextElement(T* toEntity)
    223227{
    224   if( this->last == this->first) return NULL;
     228  //if( this->last == this->first == NULL) return NULL;
     229  if(this->size == 0) return NULL;
    225230  if( toEntity == NULL) return this->first->curr;
    226231  if( toEntity == this->last->curr ) return this->first->curr;
Note: See TracChangeset for help on using the changeset viewer.