ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/object.C
(Generate patch)

Comparing deliantra/server/common/object.C (file contents):
Revision 1.292 by root, Mon Oct 19 21:48:49 2009 UTC vs.
Revision 1.294 by root, Thu Nov 5 15:43:21 2009 UTC

37static const uint64 UUID_GAP = 1<<19; 37static const uint64 UUID_GAP = 1<<19;
38uint32_t mapspace::smellcount = 10000; 38uint32_t mapspace::smellcount = 10000;
39 39
40objectvec objects; 40objectvec objects;
41activevec actives; 41activevec actives;
42
43//+GPL
42 44
43short freearr_x[SIZEOFFREE] = { 45short freearr_x[SIZEOFFREE] = {
44 0, 46 0,
45 0, 1, 1, 1, 0, -1, -1, -1, 47 0, 1, 1, 1, 0, -1, -1, -1,
46 0, 1, 2, 2, 2, 2, 2, 1, 0, -1, -2, -2, -2, -2, -2, -1, 48 0, 1, 2, 2, 2, 2, 2, 1, 0, -1, -2, -2, -2, -2, -2, -1,
1041 * the previous environment. 1043 * the previous environment.
1042 */ 1044 */
1043void 1045void
1044object::do_remove () 1046object::do_remove ()
1045{ 1047{
1046 object *tmp, *last = 0;
1047 object *otmp;
1048
1049 if (flag [FLAG_REMOVED]) 1048 if (flag [FLAG_REMOVED])
1050 return; 1049 return;
1051 1050
1052 INVOKE_OBJECT (REMOVE, this); 1051 INVOKE_OBJECT (REMOVE, this);
1053 1052
1159 //TODO: update floorbox to preserve ordering 1158 //TODO: update floorbox to preserve ordering
1160 if (pl->contr->ns) 1159 if (pl->contr->ns)
1161 pl->contr->ns->floorbox_update (); 1160 pl->contr->ns->floorbox_update ();
1162 } 1161 }
1163 1162
1163 if (check_walk_off)
1164 for (tmp = ms.bot; tmp; tmp = tmp->above) 1164 for (object *above, *tmp = ms.bot; tmp; tmp = above)
1165 { 1165 {
1166 above = tmp->above;
1167
1166 /* No point updating the players look faces if he is the object 1168 /* No point updating the players look faces if he is the object
1167 * being removed. 1169 * being removed.
1168 */ 1170 */
1169 1171
1170 /* See if object moving off should effect something */ 1172 /* See if object moving off should effect something */
1171 if (check_walk_off
1172 && ((move_type & tmp->move_off) 1173 if ((move_type & tmp->move_off)
1173 && (move_type & ~tmp->move_off & ~tmp->move_block) == 0)) 1174 && (move_type & ~tmp->move_off & ~tmp->move_block) == 0)
1174 {
1175 move_apply (tmp, this, 0); 1175 move_apply (tmp, this, 0);
1176
1177 if (destroyed ())
1178 LOG (llevError, "BUG: remove_ob(): name %s, destroyed leaving object\n", tmp->debug_desc ());
1179 } 1176 }
1180
1181 last = tmp;
1182 }
1183 1177
1184 if (affects_los ()) 1178 if (affects_los ())
1185 update_all_los (map, x, y); 1179 update_all_los (map, x, y);
1186 } 1180 }
1187} 1181}
2548 return splay (tmp); 2542 return splay (tmp);
2549 2543
2550 return 0; 2544 return 0;
2551} 2545}
2552 2546
2547//-GPL
2548
2553void 2549void
2554object::force_set_timer (int duration) 2550object::force_set_timer (int duration)
2555{ 2551{
2556 this->duration = 1; 2552 this->duration = 1;
2557 this->speed_left = -1.f; 2553 this->speed_left = -1.f;
2566 force->destroy (); 2562 force->destroy ();
2567 2563
2568 object *force = get_archetype (FORCE_NAME); 2564 object *force = get_archetype (FORCE_NAME);
2569 2565
2570 force->slaying = name; 2566 force->slaying = name;
2571
2572 force->force_set_timer (duration); 2567 force->force_set_timer (duration);
2573
2574 force->flag [FLAG_APPLIED] = true; 2568 force->flag [FLAG_APPLIED] = true;
2575 2569
2576 return insert (force); 2570 return insert (force);
2577} 2571}
2578 2572
2579void 2573void

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines