--- deliantra/server/common/button.C 2007/04/30 04:25:29 1.31 +++ deliantra/server/common/button.C 2007/05/17 21:32:08 1.32 @@ -112,12 +112,12 @@ /* Handle multipart gates. We copy the value for the other parts * from the head - this ensures that the data will consistent */ - for (tmp = tmp->more; tmp; tmp = tmp->more) + for (object *part = tmp->more; part; part = part->more) { - tmp->value = tmp->head->value; - tmp->stats.sp = tmp->head->stats.sp; - tmp->stats.hp = tmp->head->stats.hp; - tmp->set_speed (tmp->head->speed); + part->value = tmp->value; + part->stats.sp = tmp->stats.sp; + part->stats.hp = tmp->stats.hp; + part->set_speed (tmp->speed); } break; @@ -129,6 +129,7 @@ { if ((tmp->stats.sp += tmp->stats.maxsp) > 8) /* next direction */ tmp->stats.sp = ((tmp->stats.sp - 1) % 8) + 1; + animate_turning (tmp); } break; @@ -252,7 +253,7 @@ tmp->value = 0; for (ab = tmp->above; ab != NULL; ab = ab->above) { - head = ab->head ? ab->head : ab; + head = ab->head_ (); /* Same note regarding move_type for buttons above apply here. */ if (((head->move_type & tmp->move_on) || ab->move_type == 0) && (head->race == tmp->slaying || @@ -260,6 +261,7 @@ (!strcmp (tmp->slaying, "player") && head->type == PLAYER))) tmp->value = 1; } + if (tmp->value) any_down = 1; } @@ -456,7 +458,7 @@ { for (tmp = op->above; tmp; tmp = tmp->above) { - object *head = tmp->head ? tmp->head : tmp; + object *head = tmp->head_ (); /* See comment in TRIGGER_BUTTON about move_types */ if (((head->move_type & op->move_on) || head->move_type == 0) @@ -466,18 +468,24 @@ break; } } + if (op->stats.ac == push) return 0; + op->stats.ac = 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; } + trigger_move (op, push); return 0; @@ -486,6 +494,7 @@ { if (in_movement) return 0; + if (operate_altar (op, &cause)) { if (NUM_ANIMATIONS (op) > 1) @@ -493,6 +502,7 @@ SET_ANIMATION (op, 1); update_object (op, UP_OBJ_FACE); } + if (op->last_sp >= 0) { trigger_move (op, 1); @@ -509,12 +519,11 @@ op->last_sp = -op->last_sp; op->value = !op->value; } + return cause == NULL; } else - { - return 0; - } + return 0; } else {