From 3f928c81070ab3c9efa5b0dfd2ae97ca7f7efcf6 Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Fri, 14 Jun 2019 11:17:07 +0200 Subject: Makes it pass Dialyzer's checks again. --- src/shared/struct/shr_character.erl | 61 +++---------------------------------- 1 file changed, 4 insertions(+), 57 deletions(-) (limited to 'src/shared/struct/shr_character.erl') diff --git a/src/shared/struct/shr_character.erl b/src/shared/struct/shr_character.erl index 27cf81d..c2155cf 100644 --- a/src/shared/struct/shr_character.erl +++ b/src/shared/struct/shr_character.erl @@ -25,7 +25,6 @@ equipment :: shr_equipment:type(), is_using_secondary :: boolean(), statistics :: shr_statistics:type(), - attributes :: shr_attributes:type(), equipment_but_weapons_omnimods :: shr_omnimods:type(), extra_omnimods :: shr_omnimods:type(), omnimods :: shr_omnimods:type() @@ -46,7 +45,6 @@ [ get_name/1, get_equipment/1, - get_attributes/1, get_statistics/1, get_active_weapon/1, get_inactive_weapon/1, @@ -171,26 +169,14 @@ set_equipment (Eq, Char) when is_record(Char, shr_char) -> Char#shr_char.extra_omnimods ), - NewAttributes = - shr_omnimods:apply_to_attributes - ( - NewOmnimods, - shr_attributes:default() - ), - NewStatistics = - shr_omnimods:apply_to_statistics - ( - NewOmnimods, - shr_statistics:new_raw(NewAttributes) - ), + shr_omnimods:apply_to_statistics(NewOmnimods, shr_statistics:default()), Char#shr_char { equipment = Eq, equipment_but_weapons_omnimods = EquipmentButWeaponsOmnimods, omnimods = NewOmnimods, - attributes = NewAttributes, statistics = NewStatistics }; set_equipment (EqRef, CharRef) when is_record(CharRef, shr_char_ref) -> @@ -246,25 +232,13 @@ switch_weapons (Char) when is_record(Char, shr_char) -> ActiveWeaponOmnimods ), - NewAttributes = - shr_omnimods:apply_to_attributes - ( - NewOmnimods, - shr_attributes:default() - ), - NewStatistics = - shr_omnimods:apply_to_statistics - ( - NewOmnimods, - shr_statistics:new_raw(NewAttributes) - ), + shr_omnimods:apply_to_statistics(NewOmnimods, shr_statistics:default()), Char#shr_char { is_using_secondary = (not Char#shr_char.is_using_secondary), omnimods = NewOmnimods, - attributes = NewAttributes, statistics = NewStatistics }; switch_weapons (Char) when is_record(Char, shr_char_ref) -> @@ -310,9 +284,6 @@ get_inactive_weapon (#shr_char_ref{ is_using_secondary = B, equipment = E }) -> true -> shr_equipment:get_primary_weapon(E) end. --spec get_attributes (type()) -> shr_attributes:type(). -get_attributes (Char) -> Char#shr_char.attributes. - -spec get_statistics (type()) -> shr_statistics:type(). get_statistics (Char) -> Char#shr_char.statistics. @@ -332,25 +303,13 @@ set_extra_omnimods (O, Char) -> O ), - NewAttributes = - shr_omnimods:apply_to_attributes - ( - NewOmnimods, - shr_attributes:default() - ), - NewStatistics = - shr_omnimods:apply_to_statistics - ( - NewOmnimods, - shr_statistics:new_raw(NewAttributes) - ), + shr_omnimods:apply_to_statistics(NewOmnimods, shr_statistics:default()), Char#shr_char { extra_omnimods = O, omnimods = NewOmnimods, - attributes = NewAttributes, statistics = NewStatistics }. @@ -371,19 +330,8 @@ resolve (LocalOmnimods, CharRef) -> LocalOmnimods ), - NewAttributes = - shr_omnimods:apply_to_attributes - ( - NewOmnimods, - shr_attributes:default() - ), - NewStatistics = - shr_omnimods:apply_to_statistics - ( - NewOmnimods, - shr_statistics:new_raw(NewAttributes) - ), + shr_omnimods:apply_to_statistics(NewOmnimods, shr_statistics:default()), #shr_char { @@ -392,7 +340,6 @@ resolve (LocalOmnimods, CharRef) -> equipment = Eq, is_using_secondary = CharRef#shr_char_ref.is_using_secondary, statistics = NewStatistics, - attributes = NewAttributes, omnimods = NewOmnimods, extra_omnimods = LocalOmnimods }. -- cgit v1.2.3-70-g09d2