--- deliantra/server/server/skill_util.C 2007/04/29 03:44:36 1.30 +++ deliantra/server/server/skill_util.C 2007/04/29 18:11:21 1.31 @@ -323,7 +323,6 @@ * give any exp for their direct use (eg, throwing). * It returns 0 if no skill was used. */ - int do_skill (object *op, object *part, object *skill, int dir, const char *string) { @@ -909,8 +908,6 @@ static int do_skill_attack (object *tmp, object *op, const char *string, object *skill) { - int success; - if (INVOKE_OBJECT (SKILL_ATTACK, op, ARG_OBJECT (tmp), ARG_STRING (string), ARG_OBJECT (skill))) return RESULT_INT (0); @@ -972,9 +969,7 @@ return 0; } else - { - op->current_weapon = tmp; - } + op->current_weapon = tmp; } change_skill (op, find_skill_by_name (op, op->current_weapon->skill), 1); @@ -991,11 +986,11 @@ update_object (op, UP_OBJ_CHANGE); } - success = attack_ob (tmp, op); + int success = attack_ob (tmp, op); /* print appropriate messages to the player */ - if (success && string != NULL && tmp && !QUERY_FLAG (tmp, FLAG_FREED)) + if (success && string && tmp && !QUERY_FLAG (tmp, FLAG_FREED)) { if (op->type == PLAYER) new_draw_info_format (NDI_UNIQUE, 0, op, "You %s %s!", string, query_name (tmp)); @@ -1033,8 +1028,7 @@ /* If we don't yet have an opponent, find if one exists, and attack. * Legal opponents are the same as outlined in move_player_attack() */ - - if (tmp == NULL) + if (!tmp) { m = pl->map; tx = pl->x + freearr_x[dir]; @@ -1054,13 +1048,16 @@ /* Don't attack party members */ if ((pl->type == PLAYER && tmp->type == PLAYER) && (pl->contr->party != NULL && pl->contr->party == tmp->contr->party)) return 0; + break; } } + if (!tmp) { if (pl->type == PLAYER) new_draw_info (NDI_UNIQUE, 0, pl, "There is nothing to attack!"); + return 0; }