summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/tile/global.m4.conf9
-rw-r--r--src/battle/struct/btl_tile.erl1
2 files changed, 10 insertions, 0 deletions
diff --git a/data/tile/global.m4.conf b/data/tile/global.m4.conf
index 686e4f9..c470c7c 100644
--- a/data/tile/global.m4.conf
+++ b/data/tile/global.m4.conf
@@ -10,5 +10,14 @@ m4_define(`__TILE_CLASS_ERLANG_STYLE',`from_id (`$1') ->
class_range_min = $4,
class_range_max = $5
};')m4_dnl
+m4_define(`__TILE_CLASS_JSON_STYLE',` {
+ "msg": "add_tile",
+ "id": $1,
+ "nam": "[__TILE_CATEGORY_NAME] $2",
+ "ct": $3,
+ "rmi": $4,
+ "rma": $5
+ },')m4_dnl
m4_define(`__TILE_CATEGORY',`m4_define(`__TILE_CATEGORY_NAME', `$1')')m4_dnl
m4_define(`__TILE_CLASS_USE_ERLANG_STYLE',`__TILE_CHOOSE_STYLE(`__TILE_CLASS_ERLANG_STYLE')')m4_dnl
+m4_define(`__TILE_CLASS_USE_JSON_STYLE',`__TILE_CHOOSE_STYLE(`__TILE_CLASS_JSON_STYLE')')m4_dnl
diff --git a/src/battle/struct/btl_tile.erl b/src/battle/struct/btl_tile.erl
index 2ac3832..479e37e 100644
--- a/src/battle/struct/btl_tile.erl
+++ b/src/battle/struct/btl_tile.erl
@@ -62,6 +62,7 @@ class_id_to_type_id (ClassID) ->
end.
-spec from_id (id()) -> type().
+
from_id (0) ->
#tile
{