- transitioned Blood's give command and changed SW's not to call the cheat handler.

This commit is contained in:
Christoph Oelckers 2020-09-03 16:31:31 +02:00
parent 3e5e956b72
commit fb334e7f1a
8 changed files with 141 additions and 84 deletions

View file

@ -138,4 +138,32 @@ CCMD(allmap)
gFullMap = !gFullMap;
Printf("%s\n", GStrings(gFullMap ? "SHOW MAP: ON" : "SHOW MAP: OFF"));
}
}
CCMD(give)
{
static const char* type[] = { "ALL","AMMO","ARMOR","HEALTH","INVENTORY","ITEMS","KEYS","WEAPONS",nullptr };
if (argv.argc() < 2)
{
Printf("give <all|health|weapons|ammo|armor|keys|inventory>: gives requested item\n");
return;
}
size_t found = -1;
for (size_t i = 0; i < countof(type); i++)
{
if (!stricmp(argv[1], type[i]))
{
found = i;
break;
}
}
if (found == -1)
{
Printf("Unable to give %s\n", argv[1]);
}
if (!CheckCheatmode(true, true))
{
Net_WriteByte(DEM_GIVE);
Net_WriteByte(found);
}
}