fix incomplete add [disable] abilityto abilities used like weapon special

This commit is contained in:
newfrenchy83 2024-08-14 15:03:06 +02:00 committed by Pentarctagon
parent 0cf9490409
commit 8f20c12e3d
3 changed files with 7 additions and 7 deletions

View file

@ -120,7 +120,6 @@
{DEFAULT_KEY delayed_variable_substitution bool yes}
[/tag]
[/tag]
{BASED_ON_SPECIAL "disable"}
{BASED_ON_SPECIAL "attacks"}
{BASED_ON_SPECIAL "swarm"}
{BASED_ON_SPECIAL "chance_to_hit"}
@ -134,6 +133,7 @@
{BASED_ON_SPECIAL "poison"}
{BASED_ON_SPECIAL "slow"}
{BASED_ON_SPECIAL "petrifies"}
{BASED_ON_SPECIAL "disable"}
[tag]
name="*"
max=infinite

View file

@ -31,11 +31,6 @@
max=infinite
super="units/unit_type/attack/specials/~generic~"
[/tag]
[tag]
name="disable"
max=infinite
super="units/unit_type/attack/specials/~generic~"
[/tag]
[tag]
name="slow"
max=infinite
@ -124,6 +119,11 @@
{SIMPLE_KEY swarm_attacks_max f_int}
{SIMPLE_KEY swarm_attacks_min f_int}
[/tag]
[tag]
name="disable"
max=infinite
super="units/unit_type/attack/specials/~generic~"
[/tag]
[tag]
name="*"
max=infinite

View file

@ -149,7 +149,7 @@ battle_context_unit_stats::battle_context_unit_stats(nonempty_unit_const_ptr up,
{
const int distance = distance_between(u_loc, opp_loc);
const bool out_of_range = distance > weapon->max_range() || distance < weapon->min_range();
disable = weapon->has_special("disable") || out_of_range;
disable = weapon->has_special_or_ability("disable") || out_of_range;
}
// Handle plague.