1 | /* |
1 | /* |
2 | * static char *rcsid_button_c = |
2 | * static char *rcsid_button_c = |
3 | * "$Id: button.c,v 1.1.1.1 2006/02/03 07:11:30 root Exp $"; |
3 | * "$Id: button.c,v 1.1.1.2 2006/02/22 18:01:17 elmex Exp $"; |
4 | */ |
4 | */ |
5 | |
5 | |
6 | /* |
6 | /* |
7 | CrossFire, A Multiplayer game for X-windows |
7 | CrossFire, A Multiplayer game for X-windows |
8 | |
8 | |
… | |
… | |
277 | * 0.93.4: Linked objects (ie, objects that are connected) can not be |
277 | * 0.93.4: Linked objects (ie, objects that are connected) can not be |
278 | * sacrificed. This fixes a bug of trying to put multiple altars/related |
278 | * sacrificed. This fixes a bug of trying to put multiple altars/related |
279 | * objects on the same space that take the same sacrifice. |
279 | * objects on the same space that take the same sacrifice. |
280 | */ |
280 | */ |
281 | |
281 | |
282 | int check_altar_sacrifice (object *altar, object *sacrifice) |
282 | int check_altar_sacrifice (const object *altar, const object *sacrifice) |
283 | { |
283 | { |
284 | if ( ! QUERY_FLAG (sacrifice, FLAG_ALIVE) |
284 | if ( ! QUERY_FLAG (sacrifice, FLAG_ALIVE) |
285 | && ! QUERY_FLAG (sacrifice, FLAG_IS_LINKED) |
285 | && ! QUERY_FLAG (sacrifice, FLAG_IS_LINKED) |
286 | && sacrifice->type != PLAYER) |
286 | && sacrifice->type != PLAYER) |
287 | { |
287 | { |
… | |
… | |
562 | |
562 | |
563 | /* |
563 | /* |
564 | * Return the first objectlink in the objects linked to this one |
564 | * Return the first objectlink in the objects linked to this one |
565 | */ |
565 | */ |
566 | |
566 | |
567 | objectlink *get_button_links(object *button) { |
567 | objectlink *get_button_links(const object *button) { |
568 | oblinkpt *obp; |
568 | oblinkpt *obp; |
569 | objectlink *ol; |
569 | objectlink *ol; |
570 | |
570 | |
571 | if (!button->map) |
571 | if (!button->map) |
572 | return NULL; |
572 | return NULL; |
… | |
… | |
579 | |
579 | |
580 | /* |
580 | /* |
581 | * Made as a separate function to increase efficiency |
581 | * Made as a separate function to increase efficiency |
582 | */ |
582 | */ |
583 | |
583 | |
584 | int get_button_value(object *button) { |
584 | int get_button_value(const object *button) { |
585 | oblinkpt *obp; |
585 | oblinkpt *obp; |
586 | objectlink *ol; |
586 | objectlink *ol; |
587 | |
587 | |
588 | if (!button->map) |
588 | if (!button->map) |
589 | return 0; |
589 | return 0; |
… | |
… | |
676 | * slaying = match object slaying flag |
676 | * slaying = match object slaying flag |
677 | * race = match object archetype name flag |
677 | * race = match object archetype name flag |
678 | * hp = match object type (excpt type '0'== PLAYER) |
678 | * hp = match object type (excpt type '0'== PLAYER) |
679 | */ |
679 | */ |
680 | |
680 | |
681 | object * check_inv_recursive(object *op, object *trig) |
681 | object * check_inv_recursive(object *op, const object *trig) |
682 | { |
682 | { |
683 | object *tmp,*ret=NULL; |
683 | object *tmp,*ret=NULL; |
684 | |
684 | |
685 | /* First check the object itself. */ |
685 | /* First check the object itself. */ |
686 | if((trig->stats.hp && (op->type == trig->stats.hp)) |
686 | if((trig->stats.hp && (op->type == trig->stats.hp)) |
… | |
… | |
727 | |
727 | |
728 | /* This does a minimal check of the button link consistency for object |
728 | /* This does a minimal check of the button link consistency for object |
729 | * map. All it really does it much sure the object id link that is set |
729 | * map. All it really does it much sure the object id link that is set |
730 | * matches what the object has. |
730 | * matches what the object has. |
731 | */ |
731 | */ |
732 | void verify_button_links(mapstruct *map) { |
732 | void verify_button_links(const mapstruct *map) { |
733 | oblinkpt *obp; |
733 | oblinkpt *obp; |
734 | objectlink *ol; |
734 | objectlink *ol; |
735 | |
735 | |
736 | if (!map) return; |
736 | if (!map) return; |
737 | |
737 | |