Crossfire Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

light bug



Lights loaded from maps are not being linked into the light list since 
that code is now using insert_ob_in_map_simple().  This patch makes 
insert_ob_in_map_simple() link lights.


Index: common/object.c
===================================================================
RCS file: /home/jhantin/Repository/crossfire/common/object.c,v
retrieving revision 1.3
diff -b -c -5 -r1.3 object.c
*** common/object.c	2000/06/07 01:08:40	1.3
--- common/object.c	2000/06/09 02:51:26
***************
*** 1309,1318 ****
--- 1309,1331 ----
        }
      }
    }
    else
      set_map_ob(op->map,op->x,op->y,op);   /* Tell the map that we're here */
+ 
+   /* build up linked list of light sources in each map. We do
+    * this even for non-dark maps, as down the line we might make
+    * a spell/effect which effects the global light of any map.
+    * -b.t.
+    */
+ #ifdef USE_LIGHTING
+         if(op->glow_radius>0&&light_not_listed(op)) {
+ 		add_light_to_map(op,m);
+ 		update_all_los(m);
+ 	} else if(m->darkness&&(op->glow_radius>0||op->lights)) /* a light moved, check los */
+ 		update_all_los(m);
+ #endif 
    
    if(op->type==PLAYER)
      op->contr->do_los=1;
    for(tmp=get_map_ob(op->map,op->x,op->y);tmp!=NULL;tmp=tmp->above)
      switch(tmp->type) {