--- deliantra/server/common/button.c 2006/02/03 07:11:30 1.1 +++ deliantra/server/common/button.c 2006/07/09 11:11:13 1.2 @@ -279,7 +279,7 @@ * objects on the same space that take the same sacrifice. */ -int check_altar_sacrifice (object *altar, object *sacrifice) +int check_altar_sacrifice (const object *altar, const object *sacrifice) { if ( ! QUERY_FLAG (sacrifice, FLAG_ALIVE) && ! QUERY_FLAG (sacrifice, FLAG_IS_LINKED) @@ -401,8 +401,10 @@ if (op->stats.ac == push) return 0; op->stats.ac = push; - SET_ANIMATION (op, push); - update_object (op, UP_OBJ_FACE); + if (NUM_ANIMATIONS(op) > 1) { + SET_ANIMATION (op, push); + update_object (op, UP_OBJ_FACE); + } if (in_movement || ! push) return 0; } @@ -426,7 +428,10 @@ if (op->stats.ac == push) return 0; op->stats.ac = push; - SET_ANIMATION (op, push); + if (NUM_ANIMATIONS(op) > 1) { + SET_ANIMATION (op, push); + update_object (op, UP_OBJ_FACE); + } update_object(op,UP_OBJ_FACE); if (in_movement || ! push) return 0; @@ -439,9 +444,10 @@ if (in_movement) return 0; if (operate_altar (op, &cause)) { - SET_ANIMATION (op, 1); - update_object(op,UP_OBJ_FACE); - + if (NUM_ANIMATIONS(op) > 1) { + SET_ANIMATION (op, 1); + update_object(op, UP_OBJ_FACE); + } if (op->last_sp >= 0) { trigger_move (op, 1); if (op->last_sp > 0) @@ -461,8 +467,10 @@ return 0; } } else { - SET_ANIMATION (op, 0); - update_object(op,UP_OBJ_FACE); + if (NUM_ANIMATIONS(op) > 1) { + SET_ANIMATION (op, 0); + update_object(op, UP_OBJ_FACE); + } /* If trigger_altar has "last_sp > 0" set on the map, * it will push the connected value only once per sacrifice. @@ -486,8 +494,10 @@ return 0; push = 1; } - SET_ANIMATION (op, push); - update_object(op,UP_OBJ_FACE); + if (NUM_ANIMATIONS(op) > 1) { + SET_ANIMATION (op, push); + update_object(op, UP_OBJ_FACE); + } trigger_move (op, push); return 1; @@ -564,7 +574,7 @@ * Return the first objectlink in the objects linked to this one */ -objectlink *get_button_links(object *button) { +objectlink *get_button_links(const object *button) { oblinkpt *obp; objectlink *ol; @@ -581,7 +591,7 @@ * Made as a separate function to increase efficiency */ -int get_button_value(object *button) { +int get_button_value(const object *button) { oblinkpt *obp; objectlink *ol; @@ -678,7 +688,7 @@ * hp = match object type (excpt type '0'== PLAYER) */ -object * check_inv_recursive(object *op, object *trig) +object * check_inv_recursive(object *op, const object *trig) { object *tmp,*ret=NULL; @@ -729,7 +739,7 @@ * map. All it really does it much sure the object id link that is set * matches what the object has. */ -void verify_button_links(mapstruct *map) { +void verify_button_links(const mapstruct *map) { oblinkpt *obp; objectlink *ol;