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.73 by root, Sun Apr 20 05:24:55 2008 UTC vs.
Revision 1.78 by root, Sun Jul 20 16:56:34 2008 UTC

32 32
33//#define TREASURE_VERBOSE 33//#define TREASURE_VERBOSE
34 34
35#include <global.h> 35#include <global.h>
36#include <treasure.h> 36#include <treasure.h>
37#include <funcpoint.h>
38#include <loader.h> 37#include <loader.h>
39 38
40extern char *spell_mapping[]; 39extern char *spell_mapping[];
41 40
42static treasurelist *first_treasurelist; 41static treasurelist *first_treasurelist;
256 return; 255 return;
257 } 256 }
258 257
259 op->expand_tail (); 258 op->expand_tail ();
260 259
261 if (op->blocked (creator->map, creator->x, creator->y)) 260 if (!creator->is_on_map () || op->blocked (creator->map, creator->x, creator->y))
262 op->destroy (); 261 op->destroy ();
263 else 262 else
264 { 263 {
265 SET_FLAG (op, FLAG_OBJ_ORIGINAL); 264 SET_FLAG (op, FLAG_OBJ_ORIGINAL);
266 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);
270 { 269 {
271 op = creator->insert (op); 270 op = creator->insert (op);
272 271
273 if ((flags & GT_APPLY) && QUERY_FLAG (creator, FLAG_MONSTER)) 272 if ((flags & GT_APPLY) && QUERY_FLAG (creator, FLAG_MONSTER))
274 monster_check_apply (creator, op); 273 monster_check_apply (creator, op);
275
276 if (flags & GT_UPDATE_INV)
277 if (object *tmp = creator->in_player ())
278 esrv_send_item (tmp, op);
279 } 274 }
280} 275}
281 276
282/* 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
283 * in the generated object 278 * in the generated object
583 if (op->type == ARMOUR) 578 if (op->type == ARMOUR)
584 ARMOUR_SPEED (op) = (ARMOUR_SPEED (op->arch) * (100 + magic * 10)) / 100; 579 ARMOUR_SPEED (op) = (ARMOUR_SPEED (op->arch) * (100 + magic * 10)) / 100;
585 580
586 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 */
587 magic = (-magic); 582 magic = (-magic);
583
588 op->weight = (op->arch->weight * (100 - magic * 10)) / 100; 584 op->weight = (op->arch->weight * (100 - magic * 10)) / 100;
589 } 585 }
590 else 586 else
591 { 587 {
592 if (op->type == ARMOUR) 588 if (op->type == ARMOUR)
593 ARMOUR_SPEED (op) = (ARMOUR_SPEED (op) * (100 + magic * 10)) / 100; 589 ARMOUR_SPEED (op) = (ARMOUR_SPEED (op) * (100 + magic * 10)) / 100;
590
594 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 */
595 magic = (-magic); 592 magic = (-magic);
593
596 op->weight = (op->weight * (100 - magic * 10)) / 100; 594 op->weight = (op->weight * (100 - magic * 10)) / 100;
597 } 595 }
598} 596}
599 597
600/* 598/*

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines