/[enigma]/enigma/src/actors.cc
ViewVC logotype

Diff of /enigma/src/actors.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.40 by dheck, Thu Sep 11 18:19:29 2003 UTC revision 1.41 by dheck, Fri Sep 12 21:51:39 2003 UTC
# Line 99  Actor::move() Line 99  Actor::move()
99      GridPos  field(actorinfo.pos);      GridPos  field(actorinfo.pos);
100      GridPos ofield(actorinfo.oldpos);      GridPos ofield(actorinfo.oldpos);
101    
     Floor *fl = GetFloor(field);  
     Item  *it = GetItem(field);  
     Stone *st = GetStone(field);  
   
102      if (field != ofield) {      if (field != ofield) {
103          // Actor entered a new field -> notify floor and item objects          // Actor entered a new field -> notify floor and item objects
104          if (fl) fl->actor_enter(this);          if (Floor *fl = GetFloor(field))
105          if (it) it->actor_enter(this);              fl->actor_enter(this);
106            if (Item *it = GetItem(field))
107                it->actor_enter(this);
108    
109          if (Floor *ofl = GetFloor(ofield))          if (Floor *ofl = GetFloor(ofield))
110              ofl->actor_leave(this);              ofl->actor_leave(this);
# Line 114  Actor::move() Line 112  Actor::move()
112              oit->actor_leave(this);              oit->actor_leave(this);
113      }      }
114    
115        Item *it = GetItem(field);
116      if (it && it->actor_hit(this))      if (it && it->actor_hit(this))
117          player::PickupItem(this, field);          player::PickupItem(this, field);
118    
119        Floor *fl = GetFloor(field);
120        it = GetItem(field);        // Item may have changed
121      bool item_covers_floor = (it && it->covers_floor());      bool item_covers_floor = (it && it->covers_floor());
122      if (!item_covers_floor)      if (!item_covers_floor && fl)
123          fl->actor_contact(this);          fl->actor_contact(this);
124    
125      if (st)      if (Stone *st = GetStone(field))
126          st->actor_inside(this);          st->actor_inside(this);
127    
128      m_sprite.move (actorinfo.pos);      m_sprite.move (actorinfo.pos);

Legend:
Removed from v.1.40  
changed lines
  Added in v.1.41

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26