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.74 by root, Mon Apr 21 23:35:24 2008 UTC vs.
Revision 1.78 by root, Sun Jul 20 16:56:34 2008 UTC

255 return; 255 return;
256 } 256 }
257 257
258 op->expand_tail (); 258 op->expand_tail ();
259 259
260 if (op->blocked (creator->map, creator->x, creator->y)) 260 if (!creator->is_on_map () || op->blocked (creator->map, creator->x, creator->y))
261 op->destroy (); 261 op->destroy ();
262 else 262 else
263 { 263 {
264 SET_FLAG (op, FLAG_OBJ_ORIGINAL); 264 SET_FLAG (op, FLAG_OBJ_ORIGINAL);
265 op->insert_at (creator, creator, INS_NO_MERGE | INS_NO_WALK_ON); 265 op->insert_at (creator, creator, INS_NO_MERGE | INS_NO_WALK_ON);
269 { 269 {
270 op = creator->insert (op); 270 op = creator->insert (op);
271 271
272 if ((flags & GT_APPLY) && QUERY_FLAG (creator, FLAG_MONSTER)) 272 if ((flags & GT_APPLY) && QUERY_FLAG (creator, FLAG_MONSTER))
273 monster_check_apply (creator, op); 273 monster_check_apply (creator, op);
274
275 if (flags & GT_UPDATE_INV)
276 if (object *tmp = creator->in_player ())
277 esrv_send_item (tmp, op);
278 } 274 }
279} 275}
280 276
281/* if there are change_xxx commands in the treasure, we include the changes 277/* if there are change_xxx commands in the treasure, we include the changes
282 * in the generated object 278 * in the generated object
582 if (op->type == ARMOUR) 578 if (op->type == ARMOUR)
583 ARMOUR_SPEED (op) = (ARMOUR_SPEED (op->arch) * (100 + magic * 10)) / 100; 579 ARMOUR_SPEED (op) = (ARMOUR_SPEED (op->arch) * (100 + magic * 10)) / 100;
584 580
585 if (magic < 0 && !(rndm (3))) /* You can't just check the weight always */ 581 if (magic < 0 && !(rndm (3))) /* You can't just check the weight always */
586 magic = (-magic); 582 magic = (-magic);
583
587 op->weight = (op->arch->weight * (100 - magic * 10)) / 100; 584 op->weight = (op->arch->weight * (100 - magic * 10)) / 100;
588 } 585 }
589 else 586 else
590 { 587 {
591 if (op->type == ARMOUR) 588 if (op->type == ARMOUR)
592 ARMOUR_SPEED (op) = (ARMOUR_SPEED (op) * (100 + magic * 10)) / 100; 589 ARMOUR_SPEED (op) = (ARMOUR_SPEED (op) * (100 + magic * 10)) / 100;
590
593 if (magic < 0 && !(rndm (3))) /* You can't just check the weight always */ 591 if (magic < 0 && !(rndm (3))) /* You can't just check the weight always */
594 magic = (-magic); 592 magic = (-magic);
593
595 op->weight = (op->weight * (100 - magic * 10)) / 100; 594 op->weight = (op->weight * (100 - magic * 10)) / 100;
596 } 595 }
597} 596}
598 597
599/* 598/*

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines