MCPcopy Index your code
hub / github.com/NetHack/NetHack / lspo_level_flags

Function lspo_level_flags

src/sp_lev.c:3758–3831  ·  view source on GitHub ↗

level_flags("noteleport", "mazelevel", ... ); */

Source from the content-addressed store, hash-verified

3756
3757/* level_flags("noteleport", "mazelevel", ... ); */
3758int
3759lspo_level_flags(lua_State *L)
3760{
3761 int argc = lua_gettop(L);
3762 int i;
3763
3764 create_des_coder();
3765
3766 if (argc < 1)
3767 nhl_error(L, "expected string params");
3768
3769 for (i = 1; i <= argc; i++) {
3770 const char *s = luaL_checkstring(L, i);
3771
3772 if (!strcmpi(s, "noteleport"))
3773 svl.level.flags.noteleport = 1;
3774 else if (!strcmpi(s, "hardfloor"))
3775 svl.level.flags.hardfloor = 1;
3776 else if (!strcmpi(s, "nommap"))
3777 svl.level.flags.nommap = 1;
3778 else if (!strcmpi(s, "shortsighted"))
3779 svl.level.flags.shortsighted = 1;
3780 else if (!strcmpi(s, "arboreal"))
3781 svl.level.flags.arboreal = 1;
3782 else if (!strcmpi(s, "mazelevel"))
3783 svl.level.flags.is_maze_lev = 1;
3784 else if (!strcmpi(s, "shroud"))
3785 svl.level.flags.hero_memory = 1;
3786 else if (!strcmpi(s, "graveyard"))
3787 svl.level.flags.graveyard = 1;
3788 else if (!strcmpi(s, "icedpools"))
3789 icedpools = 1;
3790 else if (!strcmpi(s, "corrmaze"))
3791 svl.level.flags.corrmaze = 1;
3792 else if (!strcmpi(s, "premapped"))
3793 gc.coder->premapped = 1;
3794 else if (!strcmpi(s, "solidify"))
3795 gc.coder->solidify = 1;
3796 else if (!strcmpi(s, "sokoban"))
3797 Sokoban = 1; /* svl.level.flags.sokoban_rules */
3798 else if (!strcmpi(s, "inaccessibles"))
3799 gc.coder->check_inaccessibles = 1;
3800 else if (!strcmpi(s, "noflipx"))
3801 gc.coder->allow_flips &= ~2;
3802 else if (!strcmpi(s, "noflipy"))
3803 gc.coder->allow_flips &= ~1;
3804 else if (!strcmpi(s, "noflip"))
3805 gc.coder->allow_flips = 0;
3806 else if (!strcmpi(s, "temperate"))
3807 svl.level.flags.temperature = 0;
3808 else if (!strcmpi(s, "hot"))
3809 svl.level.flags.temperature = 1;
3810 else if (!strcmpi(s, "cold"))
3811 svl.level.flags.temperature = -1;
3812 else if (!strcmpi(s, "nomongen"))
3813 svl.level.flags.rndmongen = 0;
3814 else if (!strcmpi(s, "nodeathdrops"))
3815 svl.level.flags.deathdrops = 0;

Callers

nothing calls this directly

Calls 2

create_des_coderFunction · 0.85
nhl_errorFunction · 0.85

Tested by

no test coverage detected