--- deliantra/server/common/map.C 2007/09/30 20:22:14 1.130
+++ deliantra/server/common/map.C 2008/04/30 16:26:28 1.137
@@ -1,11 +1,11 @@
/*
- * This file is part of Crossfire TRT, the Roguelike Realtime MORPG.
+ * This file is part of Deliantra, the Roguelike Realtime MMORPG.
*
- * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Crossfire TRT team
+ * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
* Copyright (©) 2001-2003,2007 Mark Wedel & Crossfire Development Team
* Copyright (©) 1992,2007 Frank Tore Johansen
*
- * Crossfire TRT is free software: you can redistribute it and/or modify
+ * Deliantra is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
@@ -18,13 +18,12 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
- * The authors can be reached via e-mail to
+ * The authors can be reached via e-mail to
*/
#include
#include "global.h"
-#include "funcpoint.h"
#include "loader.h"
@@ -247,10 +246,9 @@
tmp = next;
}
- /* sum_weight will go through and calculate what all the containers are
- * carrying.
- */
- sum_weight (container);
+ // go through and calculate what all the containers are carrying.
+ //TODO: remove
+ container->update_weight ();
}
void
@@ -309,15 +307,16 @@
{
for (;;)
{
- coroapi::cede_to_tick_every (100); // cede once in a while
+ coroapi::cede_to_tick (); // cede once in a while
switch (f.kw)
{
case KW_arch:
if (object *op = object::read (f, this))
{
+ // TODO: why?
if (op->inv)
- sum_weight (op);
+ op->update_weight ();
if (IN_RANGE_EXC (op->x, 0, width) && IN_RANGE_EXC (op->y, 0, height))
{
@@ -814,13 +813,13 @@
}
}
- sfree (spaces, size ()), spaces = 0;
+ sfree0 (spaces, size ());
}
if (buttons)
free_objectlinkpt (buttons), buttons = 0;
- sfree (regions, size ()); regions = 0;
+ sfree0 (regions, size ());
delete [] regionmap; regionmap = 0;
}
@@ -1223,7 +1222,7 @@
if (!tile_path[dir])
return 0;
- if (tile_map[dir] && (!load || tile_map[dir]->in_memory == MAP_IN_MEMORY))
+ if (tile_map[dir] && (!load || tile_map[dir]->in_memory == MAP_ACTIVE))
return 1;
if ((tile_map[dir] = find_async (tile_path[dir], this, load)))
@@ -1622,11 +1621,11 @@
return;
for_all_players (pl)
- if (pl->observe->map == this)
+ if (pl->ob->map == this)
if (client *ns = pl->ns)
{
- int dx = x - pl->observe->x;
- int dy = y - pl->observe->y;
+ int dx = x - pl->ob->x;
+ int dy = y - pl->ob->y;
int distance = idistance (dx, dy);