Crossfire Server, Trunk  R20805
legacy_describe.c
Go to the documentation of this file.
1 /*
2  CrossFire, A Multiplayer game for X-windows
3 
4  Copyright (C) 2007 Mark Wedel & Crossfire Development Team
5  Copyright (C) 1992 Frank Tore Johansen
6 
7  This program is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation; either version 2 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21  The authors can be reached via e-mail at crossfire-devel@real-time.com
22 */
23 #include <global.h>
24 #include <ob_methods.h>
25 #include <ob_types.h>
38 void legacy_ob_describe(const ob_methods *context, const object *op, const object *observer, char *buf, size_t size) {
39  buf[0] = '\0';
40  if (op == NULL)
41  return;
42 
43  switch (op->type) {
44  case RING:
45  case SKILL:
46  case WEAPON:
47  case ARMOUR:
48  case BRACERS:
49  case HELMET:
50  case SHIELD:
51  case BOOTS:
52  case GLOVES:
53  case AMULET:
54  case GIRDLE:
55  case BOW:
56  case ARROW:
57  case CLOAK:
58  case FOOD:
59  case DRINK:
60  case FLESH:
61  case SKILL_TOOL:
62  case LAMP:
63  common_ob_describe(context, op, observer, buf, size);
64  return;
65 
66  default:
67  if (buf[0] == '\0') {
68  query_name(op, buf, size-1);
69  buf[size-1] = 0;
70  }
71  return;
72  }
73 }
Definition: object.h:185
Definition: object.h:204
Definition: object.h:112
Definition: object.h:117
Definition: object.h:119
Definition: object.h:136
Definition: object.h:157
Definition: object.h:223
Definition: object.h:139
Definition: object.h:187
Definition: object.h:212
Definition: object.h:118
void common_ob_describe(const ob_methods *context, const object *op, const object *observer, char *buf, size_t size)
Definition: describe.c:36
Definition: object.h:201
Definition: object.h:135
Definition: object.h:143
uint8_t type
Definition: object.h:338
void legacy_ob_describe(const ob_methods *context, const object *op, const object *observer, char *buf, size_t size)
Definition: object.h:213
void query_name(const object *op, char *buf, size_t size)
Definition: item.c:626
Definition: object.h:120