… | |
… | |
2700 | esrv_update_item (UPD_FLAGS, this, new_container); |
2700 | esrv_update_item (UPD_FLAGS, this, new_container); |
2701 | esrv_send_inventory (this, new_container); |
2701 | esrv_send_inventory (this, new_container); |
2702 | } |
2702 | } |
2703 | } |
2703 | } |
2704 | |
2704 | |
|
|
2705 | object * |
|
|
2706 | object::force_find (const shstr name) |
|
|
2707 | { |
|
|
2708 | /* cycle through his inventory to look for the MARK we want to |
|
|
2709 | * place |
|
|
2710 | */ |
|
|
2711 | for (object *tmp = inv; tmp; tmp = tmp->below) |
|
|
2712 | if (tmp->type == FORCE && tmp->slaying == name) |
|
|
2713 | return splay (tmp); |
2705 | |
2714 | |
|
|
2715 | return 0; |
|
|
2716 | } |
|
|
2717 | |
|
|
2718 | void |
|
|
2719 | object::force_add (const shstr name, int duration) |
|
|
2720 | { |
|
|
2721 | if (object *force = force_find (name)) |
|
|
2722 | force->destroy (); |
|
|
2723 | |
|
|
2724 | object *force = get_archetype (FORCE_NAME); |
|
|
2725 | |
|
|
2726 | force->slaying = name; |
|
|
2727 | force->stats.food = 1; |
|
|
2728 | force->speed_left = -1.f; |
|
|
2729 | |
|
|
2730 | force->set_speed (duration ? 1.f / duration : 0.f); |
|
|
2731 | force->flag [FLAG_IS_USED_UP] = true; |
|
|
2732 | force->flag [FLAG_APPLIED] = true; |
|
|
2733 | |
|
|
2734 | insert (force); |
|
|
2735 | } |
|
|
2736 | |
|
|
2737 | |