aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2019-09-06 23:41:26 +0200
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2019-09-06 23:41:26 +0200
commit0f890f3730a0531bc397f317c329f3beb9fc740d (patch)
tree58fb661d6336ea535edffd8780c2bbd1952077ba
parent9a3e0fb6c22d54bbd445e2d792a7554015acacad (diff)
downloadtacticians-server-0f890f3730a0531bc397f317c329f3beb9fc740d.zip
tacticians-server-0f890f3730a0531bc397f317c329f3beb9fc740d.tar.bz2
Saner default equipment.
-rw-r--r--src/shared/struct/inventory/shr_equipment.erl17
-rw-r--r--src/shared/struct/inventory/shr_weapon.erl.m44
2 files changed, 16 insertions, 5 deletions
diff --git a/src/shared/struct/inventory/shr_equipment.erl b/src/shared/struct/inventory/shr_equipment.erl
index 830896c..ceeefd1 100644
--- a/src/shared/struct/inventory/shr_equipment.erl
+++ b/src/shared/struct/inventory/shr_equipment.erl
@@ -468,14 +468,20 @@ ataxia_set_glyph_ids (V, VUpdate, Eq) ->
-spec default () -> type().
default () ->
+ DefaultGlyphBoard = shr_glyph_board:default(),
#shr_eq
{
primary = shr_weapon:default(),
secondary = shr_weapon:default(),
armor = shr_armor:default(),
portrait = shr_portrait:default(),
- glyph_board = shr_glyph_board:default(),
- glyphs = []
+ glyph_board = DefaultGlyphBoard,
+ glyphs =
+ lists:map
+ (
+ fun (_E) -> shr_glyph:default() end,
+ shr_glyph_board:get_slots(DefaultGlyphBoard)
+ )
}.
-spec default_unresolved () -> unresolved().
@@ -487,7 +493,12 @@ default_unresolved () ->
armor = shr_armor:default_id(),
portrait = shr_portrait:default_id(),
glyph_board = shr_glyph_board:default_id(),
- glyphs = []
+ glyphs =
+ lists:map
+ (
+ fun (_E) -> shr_glyph:default() end,
+ shr_glyph_board:get_slots(shr_glyph_board:default())
+ )
}.
-spec decode (map()) -> unresolved().
diff --git a/src/shared/struct/inventory/shr_weapon.erl.m4 b/src/shared/struct/inventory/shr_weapon.erl.m4
index 8492189..ce87045 100644
--- a/src/shared/struct/inventory/shr_weapon.erl.m4
+++ b/src/shared/struct/inventory/shr_weapon.erl.m4
@@ -82,7 +82,7 @@ from_id (_) ->
default().
-spec default () -> type().
-default () -> from_id(<<"0">>).
+default () -> from_id(<<"s0">>).
-spec default_id () -> id().
-default_id () -> <<"0">>.
+default_id () -> <<"s0">>.