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

Comparing deliantra/server/common/arch.C (file contents):
Revision 1.64 by root, Tue Jun 5 13:05:02 2007 UTC vs.
Revision 1.65 by root, Thu Jun 7 18:55:24 2007 UTC

157 } 157 }
158 158
159 return create_singularity (name); 159 return create_singularity (name);
160} 160}
161 161
162 /* This is a subset of the parse_id command. Basically, name can be 162/* This is a subset of the parse_id command. Basically, name can be
163 * a string seperated lists of things to match, with certain keywords. 163 * a string seperated lists of things to match, with certain keywords.
164 * pl is the player (only needed to set count properly) 164 * pl is the player (only needed to set count properly)
165 * op is the item we are trying to match. Calling function takes care 165 * op is the item we are trying to match. Calling function takes care
166 * of what action might need to be done and if it is valid 166 * of what action might need to be done and if it is valid
167 * (pickup, drop, etc.) Return NONZERO if we have a match. A higher 167 * (pickup, drop, etc.) Return NONZERO if we have a match. A higher
168 * value means a better match. 0 means no match. 168 * value means a better match. 0 means no match.
169 * 169 *
170 * Brief outline of the procedure: 170 * Brief outline of the procedure:
171 * We take apart the name variable into the individual components. 171 * We take apart the name variable into the individual components.
172 * cases for 'all' and unpaid are pretty obvious. 172 * cases for 'all' and unpaid are pretty obvious.
173 * Next, we check for a count (either specified in name, or in the 173 * Next, we check for a count (either specified in name, or in the
174 * player object.) 174 * player object.)
175 * If count is 1, make a quick check on the name. 175 * If count is 1, make a quick check on the name.
176 * IF count is >1, we need to make plural name. Return if match. 176 * IF count is >1, we need to make plural name. Return if match.
177 * Last, make a check on the full name. 177 * Last, make a check on the full name.
178 */ 178 */
179int 179int
180item_matched_string (object *pl, object *op, const char *name) 180item_matched_string (object *pl, object *op, const char *name)
181{ 181{
182 char *cp, local_name[MAX_BUF]; 182 char *cp, local_name[MAX_BUF];
183 int count, retval = 0; 183 int count, retval = 0;
514 * an object, and never NULL. 514 * an object, and never NULL.
515 */ 515 */
516object * 516object *
517create_singularity (const char *name) 517create_singularity (const char *name)
518{ 518{
519 object *op; 519 LOG (llevError | logBacktrace, "FATAL: creating singularity for '%s'.\n", name);
520
521 if (!strcmp (name, "bug"))
522 abort ();
523
520 char buf[MAX_BUF]; 524 char buf[MAX_BUF];
521
522 sprintf (buf, "%s (%s)", ARCH_SINGULARITY, name); 525 sprintf (buf, "bug, please report (%s)", ARCH_SINGULARITY, name);
523 op = object::create (); 526
527 object *op = get_archetype ("bug");
524 op->name = op->name_pl = buf; 528 op->name = op->name_pl = buf;
525 SET_FLAG (op, FLAG_NO_PICK); 529
526 return op; 530 return op;
527} 531}
528 532
529/* 533/*
530 * Finds which archetype matches the given name, and returns a new 534 * Finds which archetype matches the given name, and returns a new

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines