/[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.38 by dheck, Mon Sep 8 08:33:34 2003 UTC revision 1.39 by dheck, Tue Sep 9 19:24:32 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    
102        Floor *fl = GetFloor(field);
103        Item  *it = GetItem(field);
104        Stone *st = GetStone(field);
105    
106      if (field != ofield) {      if (field != ofield) {
107          if (Floor *fl = GetFloor(field))          // Actor entered a new field -> notify floor and item objects
108              fl->actor_enter(this);          if (fl) fl->actor_enter(this);
109            if (it) it->actor_enter(this);
110    
111          if (Floor *ofl = GetFloor(ofield))          if (Floor *ofl = GetFloor(ofield))
112              ofl->actor_leave(this);              ofl->actor_leave(this);
   
         if (Item *it = GetItem(field))  
             it->actor_enter(this);  
113          if (Item *oit = GetItem(ofield))          if (Item *oit = GetItem(ofield))
114              oit->actor_leave(this);              oit->actor_leave(this);
115      }      }
     if (Floor *fl = GetFloor(field))  
         fl->actor_contact(this);  
116    
117      if (Item *it = GetItem(field))      if (it && it->actor_hit(this))
118          if (it->actor_hit(this))          player::PickupItem(this, field);
119              player::PickupItem(this, field);  
120        bool item_covers_floor = (it && it->covers_floor());
121        if (!item_covers_floor)
122            fl->actor_contact(this);
123    
124      if (Stone *st = GetStone(field))      if (st)
125          st->actor_inside(this);          st->actor_inside(this);
126    
127      m_sprite.move (actorinfo.pos);      m_sprite.move (actorinfo.pos);

Legend:
Removed from v.1.38  
changed lines
  Added in v.1.39

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