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

Comparing deliantra/server/common/map.C (file contents):
Revision 1.129 by root, Wed Sep 12 11:10:09 2007 UTC vs.
Revision 1.131 by root, Thu Oct 4 11:48:06 2007 UTC

317 if (object *op = object::read (f, this)) 317 if (object *op = object::read (f, this))
318 { 318 {
319 if (op->inv) 319 if (op->inv)
320 sum_weight (op); 320 sum_weight (op);
321 321
322 insert_ob_in_map (op, this, op, INS_NO_MERGE | INS_NO_WALK_ON | INS_ON_TOP | INS_MAP_LOAD); 322 if (IN_RANGE_EXC (op->x, 0, width) && IN_RANGE_EXC (op->y, 0, height))
323 {
324 // we insert manually because
325 // a) its way faster
326 // b) we remove manually, too, and there are good reasons for that
327 // c) its correct
328 mapspace &ms = at (op->x, op->y);
329
330 op->flag [FLAG_REMOVED] = false;
331
332 op->above = 0;
333 op->below = ms.top;
334
335 if (ms.top)
336 ms.top->above = op;
337 else
338 ms.bot = op;
339
340 ms.top = op;
341 ms.flags_ = 0;
342 }
343 else
344 {
345 f.parse_warn (format ("object %s out of range", op->debug_desc ()));
346 op->destroy ();
347 }
323 } 348 }
324 349
325 continue; 350 continue;
326 351
327 case KW_EOF: 352 case KW_EOF:
1595{ 1620{
1596 if (!sound) 1621 if (!sound)
1597 return; 1622 return;
1598 1623
1599 for_all_players (pl) 1624 for_all_players (pl)
1600 if (pl->observe->map == this) 1625 if (pl->ob->map == this)
1601 if (client *ns = pl->ns) 1626 if (client *ns = pl->ns)
1602 { 1627 {
1603 int dx = x - pl->observe->x; 1628 int dx = x - pl->ob->x;
1604 int dy = y - pl->observe->y; 1629 int dy = y - pl->ob->y;
1605 1630
1606 int distance = idistance (dx, dy); 1631 int distance = idistance (dx, dy);
1607 1632
1608 if (distance <= MAX_SOUND_DISTANCE) 1633 if (distance <= MAX_SOUND_DISTANCE)
1609 ns->play_sound (sound, dx, dy); 1634 ns->play_sound (sound, dx, dy);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines