Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

GRIM: A better fix for removeSprite.

  • Loading branch information...
commit 892fa3d9954aa502e5a403635314e6cc640c9767 1 parent 08e1f09
@Akz- Akz- authored
Showing with 10 additions and 14 deletions.
  1. +10 −14 engines/grim/model.cpp
View
24 engines/grim/model.cpp
@@ -581,21 +581,17 @@ void Model::HierNode::addSprite(Sprite *sprite) {
}
void Model::HierNode::removeSprite(Sprite *sprite) {
- if (_sprite == sprite) {
- _sprite = _sprite->_next;
- } else {
- Sprite* curr = _sprite;
- Sprite* prev = NULL;
- while (curr->_next) {
- if (curr == sprite) {
- if (prev)
- prev->_next = curr->_next;
- else
- _sprite = curr->_next;
- }
- prev = curr;
- curr = curr->_next;
+ Sprite* curr = _sprite;
+ Sprite* prev = NULL;
+ while (curr) {
+ if (curr == sprite) {
+ if (prev)
+ prev->_next = curr->_next;
+ else
+ _sprite = curr->_next;
}
+ prev = curr;
+ curr = curr->_next;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.