--- deliantra/server/server/apply.C 2006/12/19 20:32:35 1.47 +++ deliantra/server/server/apply.C 2006/12/20 09:14:22 1.48 @@ -197,7 +197,7 @@ int got_one = 0, i; object *force = 0, *floor = 0; - floor = get_map_ob (op->map, op->x, op->y); + floor = GET_MAP_OB (op->map, op->x, op->y); if (get_map_flags (op->map, NULL, op->x, op->y, NULL, NULL) & P_SAFE) { @@ -1048,7 +1048,7 @@ /* it's closed OR some player has opened it */ if (QUERY_FLAG (sack, FLAG_APPLIED)) { - for (tmp = get_map_ob (sack->map, sack->x, sack->y); tmp && tmp->container != sack; tmp = tmp->above); + for (tmp = GET_MAP_OB (sack->map, sack->x, sack->y); tmp && tmp->container != sack; tmp = tmp->above); if (tmp) { /* some other player have opened it */ @@ -1122,6 +1122,7 @@ { sprintf (buf, "You unlock %s with %s.", query_name (sack), query_name (tmp)); SET_FLAG (sack, FLAG_APPLIED); + if (sack->env == NULL) { /* if it's on ground,open it also */ new_draw_info (NDI_UNIQUE, 0, op, buf); @@ -1130,14 +1131,13 @@ } } else - { - sprintf (buf, "You don't have the key to unlock %s.", query_name (sack)); - } + sprintf (buf, "You don't have the key to unlock %s.", query_name (sack)); } else { sprintf (buf, "You readied %s.", query_name (sack)); SET_FLAG (sack, FLAG_APPLIED); + if (sack->env == NULL) { /* if it's on ground,open it also */ new_draw_info (NDI_UNIQUE, 0, op, buf); @@ -2478,10 +2478,10 @@ exitmap = ready_map_name (EXIT_PATH (exit), 0); if (exitmap) { - tmp = get_map_ob (exitmap, EXIT_X (exit), EXIT_Y (exit)); + tmp = GET_MAP_OB (exitmap, EXIT_X (exit), EXIT_Y (exit)); if (!tmp) return 0; - for ((tmp = get_map_ob (exitmap, EXIT_X (exit), EXIT_Y (exit))); tmp; tmp = tmp->above) + for ((tmp = GET_MAP_OB (exitmap, EXIT_X (exit), EXIT_Y (exit))); tmp; tmp = tmp->above) { if (tmp->type != EXIT) continue; /*Not an exit */ @@ -3729,7 +3729,7 @@ for (x = 0; x < MAP_WIDTH (m); x++) for (y = 0; y < MAP_HEIGHT (m); y++) - for (tmp = get_map_ob (m, x, y); tmp != NULL; tmp = above) + for (tmp = GET_MAP_OB (m, x, y); tmp != NULL; tmp = above) { above = tmp->above; @@ -3812,7 +3812,7 @@ for (x = 0; x < MAP_WIDTH (m); x++) for (y = 0; y < MAP_HEIGHT (m); y++) - for (tmp = get_map_ob (m, x, y); tmp != NULL; tmp = tmp->above) + for (tmp = GET_MAP_OB (m, x, y); tmp != NULL; tmp = tmp->above) if (tmp->above && (tmp->type == TRIGGER_BUTTON || tmp->type == TRIGGER_PEDESTAL)) check_trigger (tmp, tmp->above); } @@ -3915,7 +3915,6 @@ { object *item; int is_player_env = 0; - char item_name[MAX_BUF]; item = find_marked_object (who); if (item) @@ -3943,25 +3942,20 @@ new_draw_info_format (NDI_UNIQUE, 0, who, "You attempt to light the %s with a used up %s.", &item->name, &lighter->name); return; } + /* Perhaps we should split what we are trying to light on fire? * I can't see many times when you would want to light multiple * objects at once. */ - /* If the item is destroyed, we don't have a valid pointer to the - * name object, so make a copy so the message we print out makes - * some sense. - */ - strcpy (item_name, item->name); - if (who == is_player_inv (item)) + + if (who == item->in_player ()) is_player_env = 1; save_throw_object (item, AT_FIRE, who); - /* Change to check count and not freed, since the object pointer - * may have gotten recycled - */ - if (item->destroyed ()) + + if (!item->destroyed ()) { - new_draw_info_format (NDI_UNIQUE, 0, who, "You light the %s with the %s.", &item_name, &lighter->name); + new_draw_info_format (NDI_UNIQUE, 0, who, "You light the %s with the %s.", &item->name, &lighter->name); /* Need to update the player so that the players glow radius * gets changed. */