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

Comparing deliantra/server/common/treasure.C (file contents):
Revision 1.26 by elmex, Thu Dec 14 00:08:52 2006 UTC vs.
Revision 1.29 by root, Tue Dec 26 20:04:09 2006 UTC

280 * being generated. 280 * being generated.
281 * If flag is GT_INVISIBLE, only invisible objects are generated (ie, only 281 * If flag is GT_INVISIBLE, only invisible objects are generated (ie, only
282 * abilities. This is used by summon spells, thus no summoned monsters 282 * abilities. This is used by summon spells, thus no summoned monsters
283 * start with equipment, but only their abilities). 283 * start with equipment, but only their abilities).
284 */ 284 */
285
286
287static void 285static void
288put_treasure (object *op, object *creator, int flags) 286put_treasure (object *op, object *creator, int flags)
289{ 287{
290 object *tmp; 288 object *tmp;
291 289
294 * this is the original object, or if this is an object that should be created 292 * this is the original object, or if this is an object that should be created
295 * by another object. 293 * by another object.
296 */ 294 */
297 if (flags & GT_ENVIRONMENT && op->type != SPELL) 295 if (flags & GT_ENVIRONMENT && op->type != SPELL)
298 { 296 {
299 op->x = creator->x;
300 op->y = creator->y;
301 SET_FLAG (op, FLAG_OBJ_ORIGINAL); 297 SET_FLAG (op, FLAG_OBJ_ORIGINAL);
302 insert_ob_in_map (op, creator->map, op, INS_NO_MERGE | INS_NO_WALK_ON); 298 op->insert_at (creator, creator, INS_NO_MERGE | INS_NO_WALK_ON);
303 } 299 }
304 else 300 else
305 { 301 {
306 op = insert_ob_in_ob (op, creator); 302 op = creator->insert (op);
303
307 if ((flags & GT_APPLY) && QUERY_FLAG (creator, FLAG_MONSTER)) 304 if ((flags & GT_APPLY) && QUERY_FLAG (creator, FLAG_MONSTER))
308 monster_check_apply (creator, op); 305 monster_check_apply (creator, op);
306
309 if ((flags & GT_UPDATE_INV) && (tmp = is_player_inv (creator)) != NULL) 307 if ((flags & GT_UPDATE_INV) && (tmp = creator->in_player ()))
310 esrv_send_item (tmp, op); 308 esrv_send_item (tmp, op);
311 } 309 }
312} 310}
313 311
314/* if there are change_xxx commands in the treasure, we include the changes 312/* if there are change_xxx commands in the treasure, we include the changes
1499 CLEAR_FLAG (op, FLAG_ANIMATE); 1497 CLEAR_FLAG (op, FLAG_ANIMATE);
1500 /* so artifacts will join */ 1498 /* so artifacts will join */
1501 if (!QUERY_FLAG (op, FLAG_ALIVE)) 1499 if (!QUERY_FLAG (op, FLAG_ALIVE))
1502 op->speed = 0.0; 1500 op->speed = 0.0;
1503 1501
1504 update_ob_speed (op); 1502 op->set_speed (op->speed);
1505 } 1503 }
1506 1504
1507 if (change->nrof) 1505 if (change->nrof)
1508 op->nrof = RANDOM () % ((int) change->nrof) + 1; 1506 op->nrof = RANDOM () % ((int) change->nrof) + 1;
1509 1507

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines