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.27 by root, Mon Sep 11 12:08:45 2006 UTC vs.
Revision 1.28 by root, Mon Sep 11 12:10:21 2006 UTC

1
2/*
3 * static char *rcsid_object_c =
4 * "$Id: object.C,v 1.27 2006/09/11 12:08:45 root Exp $";
5 */
6
7/* 1/*
8 CrossFire, A Multiplayer game for X-windows 2 CrossFire, A Multiplayer game for X-windows
9 3
10 Copyright (C) 2001 Mark Wedel & Crossfire Development Team 4 Copyright (C) 2001 Mark Wedel & Crossfire Development Team
11 Copyright (C) 1992 Frank Tore Johansen 5 Copyright (C) 1992 Frank Tore Johansen
29 23
30/* Eneq(@csd.uu.se): Added weight-modifiers in environment of objects. 24/* Eneq(@csd.uu.se): Added weight-modifiers in environment of objects.
31 sub/add_weight will transcend the environment updating the carrying 25 sub/add_weight will transcend the environment updating the carrying
32 variable. */ 26 variable. */
33#include <global.h> 27#include <global.h>
34#ifndef WIN32 /* ---win32 exclude headers */
35# include <stdio.h> 28#include <stdio.h>
36# include <sys/types.h> 29#include <sys/types.h>
37# include <sys/uio.h> 30#include <sys/uio.h>
38#endif /* win32 */
39#include <object.h> 31#include <object.h>
40#include <funcpoint.h> 32#include <funcpoint.h>
41#include <skills.h> 33#include <skills.h>
42#include <loader.h> 34#include <loader.h>
35
43int nrofallocobjects = 0; 36int nrofallocobjects = 0;
44 37
45object *objects; /* Pointer to the list of used objects */ 38object *objects; /* Pointer to the list of used objects */
46object *active_objects; /* List of active objects that need to be processed */ 39object *active_objects; /* List of active objects that need to be processed */
47 40
249/* 242/*
250 * sum_weight() is a recursive function which calculates the weight 243 * sum_weight() is a recursive function which calculates the weight
251 * an object is carrying. It goes through in figures out how much 244 * an object is carrying. It goes through in figures out how much
252 * containers are carrying, and sums it up. 245 * containers are carrying, and sums it up.
253 */ 246 */
254signed long 247long
255sum_weight (object *op) 248sum_weight (object *op)
256{ 249{
257 signed long sum; 250 long sum;
258 object *inv; 251 object *inv;
259 252
260 for (sum = 0, inv = op->inv; inv != NULL; inv = inv->below) 253 for (sum = 0, inv = op->inv; inv != NULL; inv = inv->below)
261 { 254 {
262 if (inv->inv) 255 if (inv->inv)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines