--- deliantra/server/common/treasure.C 2007/04/19 16:23:46 1.50 +++ deliantra/server/common/treasure.C 2007/04/21 22:05:52 1.55 @@ -1,5 +1,5 @@ /* - * CrossFire, A Multiplayer game for X-windows + * CrossFire, A Multiplayer game * * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team * Copyright (C) 2002 Mark Wedel & Crossfire Development Team @@ -232,8 +232,6 @@ static void put_treasure (object *op, object *creator, int flags) { - object *tmp; - /* Bit of a hack - spells should never be put onto the map. The entire * treasure stuff is a problem - there is no clear idea of knowing * this is the original object, or if this is an object that should be created @@ -241,8 +239,15 @@ */ if (flags & GT_ENVIRONMENT && op->type != SPELL) { - SET_FLAG (op, FLAG_OBJ_ORIGINAL); - op->insert_at (creator, creator, INS_NO_MERGE | INS_NO_WALK_ON); + op->expand_tail (); + + if (ob_blocked (op, creator->map, creator->x, creator->y)) + op->destroy (); + else + { + SET_FLAG (op, FLAG_OBJ_ORIGINAL); + op->insert_at (creator, creator, INS_NO_MERGE | INS_NO_WALK_ON); + } } else { @@ -251,8 +256,9 @@ if ((flags & GT_APPLY) && QUERY_FLAG (creator, FLAG_MONSTER)) monster_check_apply (creator, op); - if ((flags & GT_UPDATE_INV) && (tmp = creator->in_player ())) - esrv_send_item (tmp, op); + if (flags & GT_UPDATE_INV) + if (object *tmp = creator->in_player ()) + esrv_send_item (tmp, op); } } @@ -1568,14 +1574,15 @@ } static int -legal_artifact_combination (object *op, artifact * art) +legal_artifact_combination (object *op, artifact *art) { int neg, success = 0; linked_char *tmp; const char *name; - if (art->allowed == (linked_char *) NULL) + if (!art->allowed) return 1; /* Ie, "all" */ + for (tmp = art->allowed; tmp; tmp = tmp->next) { #ifdef TREASURE_VERBOSE @@ -1596,6 +1603,7 @@ else if (neg) success = 1; } + return success; }