summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2019-06-14 11:17:07 +0200
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2019-06-14 11:17:07 +0200
commit3f928c81070ab3c9efa5b0dfd2ae97ca7f7efcf6 (patch)
tree4b339592db77ae83eb27ed9f5d7c83c3f293eb87 /src/shared/struct/shr_character.erl
parent6d6232f352b033797ffd339666699c2b84251f84 (diff)
Makes it pass Dialyzer's checks again.attributes_removal
Diffstat (limited to 'src/shared/struct/shr_character.erl')
-rw-r--r--src/shared/struct/shr_character.erl61
1 files changed, 4 insertions, 57 deletions
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
}.