# reset matrix
data modify storage map doors set value []
data modify storage map rooms set value []
data modify storage map others set value []

scoreboard players set line map 0
scoreboard players set column map 0
execute store result score p_rotation map run data get entity @s Rotation[0]
kill @e[tag=mappper]

summon area_effect_cloud ~ ~ ~ {Tags:["unspellable","mappper"],Duration:2147483647}
# W
execute if score p_rotation map matches 45..135 run data modify entity @e[tag=mappper,limit=1] Rotation[0] set value 90.0f
execute if score p_rotation map matches -315..-225 run data modify entity @e[tag=mappper,limit=1] Rotation[0] set value 90.0f
# N
execute if score p_rotation map matches 135..225 run data modify entity @e[tag=mappper,limit=1] Rotation[0] set value 180.0f
execute if score p_rotation map matches -225..-135 run data modify entity @e[tag=mappper,limit=1] Rotation[0] set value 180.0f
# E
execute if score p_rotation map matches 225..315 run data modify entity @e[tag=mappper,limit=1] Rotation[0] set value 270.0f
execute if score p_rotation map matches -135..-45 run data modify entity @e[tag=mappper,limit=1] Rotation[0] set value 270.0f

execute store result score rotation map run data get entity @e[tag=mappper,limit=1] Rotation[0]

execute as @e[tag=mappper,limit=1] at @s run function game:map/get/loop
