Expose traps to lua

This commit is contained in:
Pasi Kallinen
2019-12-15 18:16:41 +02:00
parent 6a71759797
commit b24f4c5929
5 changed files with 136 additions and 3 deletions

View File

@@ -1350,7 +1350,7 @@ wiz_map_levltyp(VOID_ARGS)
/* temporary? hack, since level type codes aren't the same as screen
symbols and only the latter have easily accessible descriptions */
static const char *levltyp[] = {
const char *levltyp[] = {
"stone", "vertical wall", "horizontal wall", "top-left corner wall",
"top-right corner wall", "bottom-left corner wall",
"bottom-right corner wall", "cross wall", "tee-up wall", "tee-down wall",
@@ -1366,6 +1366,15 @@ static const char *levltyp[] = {
""
};
const char *
levltyp_to_name(typ)
int typ;
{
if (typ >= 0 && typ < MAX_TYPE)
return levltyp[typ];
return NULL;
}
/* explanation of base-36 output from wiz_map_levltyp() */
static void
wiz_levltyp_legend(VOID_ARGS)