X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;f=src%2Fserver%2Fgod_commands.c;h=d91cea32d01e848d711401f2ff068ac5f1ae7d4b;hb=fcd50b57f6a17b2f4957a6231c0982136007d8cc;hp=87564043d6836433ba5e2f7ad11a7f74e558493a;hpb=6a9f579e2c47c5d60b37d343465e08faf26a9255;p=plomrogue
diff --git a/src/server/god_commands.c b/src/server/god_commands.c
index 8756404..d91cea3 100644
--- a/src/server/god_commands.c
+++ b/src/server/god_commands.c
@@ -95,12 +95,15 @@ static uint8_t parse_thingtype_manipulation(char * tok0, char * tok1)
return err_line(1, "No thing type defined to manipulate yet.");
}
int16_t id;
- if ( parse_val(tok0,tok1,s[S_CMD_TT_CONSUM],'8',(char *) &tt->consumable)
+ if ( parse_val(tok0,tok1,s[S_CMD_TT_CONSUM],'u',(char *) &tt->consumable)
|| parse_val(tok0,tok1,s[S_CMD_TT_HP],'8',(char *) &tt->lifepoints)
|| parse_val(tok0,tok1,s[S_CMD_TT_STARTN],'8',(char *) &tt->start_n)
|| parse_val(tok0,tok1,s[S_CMD_TT_SYMB],'c',(char *) &tt->char_on_map)
|| parse_val(tok0,tok1,s[S_CMD_TT_PROL],'8',(char *) &tt->proliferate)
- || parse_val(tok0,tok1,s[S_CMD_TT_NAME],'s',(char *) &tt->name));
+ || parse_val(tok0,tok1,s[S_CMD_TT_NAME],'s',(char *) &tt->name))
+ {
+ ;
+ }
else if (parse_val(tok0, tok1, s[S_CMD_TT_CORPS],'8',(char *)&id))
{
if (!get_thing_type(id))
@@ -292,7 +295,8 @@ static uint8_t parse_thing_manipulation_1arg(char * tok0, char * tok1)
( !strcmp(tok0, s[S_CMD_T_PROGRESS]) || !strcmp(tok0, s[S_CMD_T_TYPE])
|| !strcmp(tok0, s[S_CMD_T_CARRIES]) || !strcmp(tok0, s[S_CMD_T_POSY])
|| !strcmp(tok0, s[S_CMD_T_POSY]) || !strcmp(tok0, s[S_CMD_T_ARGUMENT])
- || !strcmp(tok0, s[S_CMD_T_HP]) || !strcmp(tok0, s[S_CMD_T_COMMAND])))
+ || !strcmp(tok0, s[S_CMD_T_HP]) || !strcmp(tok0, s[S_CMD_T_COMMAND])
+ || !strcmp(tok0, s[S_CMD_T_SATIATION])))
{
return err_line(1, "No thing defined to manipulate yet.");
}
@@ -302,6 +306,7 @@ static uint8_t parse_thing_manipulation_1arg(char * tok0, char * tok1)
|| parse_val(tok0,tok1, s[S_CMD_T_ARGUMENT], '8', (char *)&t->arg)
|| parse_val(tok0,tok1, s[S_CMD_T_PROGRESS], '8', (char *)&t->progress)
|| parse_val(tok0,tok1, s[S_CMD_T_HP], '8', (char *) &t->lifepoints)
+ || parse_val(tok0,tok1, s[S_CMD_T_SATIATION], 'i',(char *)&t->satiation)
|| parse_position(tok0, tok1, t)
|| parse_carry(tok0, tok1, t));
else if (parse_val(tok0, tok1, s[S_CMD_T_ID], 'i', (char *) &id))
@@ -449,11 +454,12 @@ extern uint8_t parse_god_command_1arg(char * tok0, char * tok1)
extern uint8_t parse_god_command_2arg(char * tok0, char * tok1, char * tok2)
{
- if (!t && !strcmp(tok0, s[S_CMD_T_MEMMAP]))
+ if (!t && ( !strcmp(tok0, s[S_CMD_T_MEMMAP])
+ || !strcmp(tok0, s[S_CMD_T_MEMDEPTHMAP])))
{
return err_line(1, "No thing defined to manipulate yet.");
}
- if (!strcmp(tok0, s[S_CMD_T_MEMMAP]))
+ if (!strcmp(tok0,s[S_CMD_T_MEMMAP]) || !strcmp(tok0,s[S_CMD_T_MEMDEPTHMAP]))
{
uint8_t y = atoi(tok1);
if (parsetest_int(tok1, '8') || y >= world.map.length)
@@ -464,11 +470,22 @@ extern uint8_t parse_god_command_2arg(char * tok0, char * tok1, char * tok2)
{
return err_line(1, "Map line length is unequal map width.");
}
- if (!t->mem_map)
+ if (!strcmp(tok0,s[S_CMD_T_MEMMAP]))
+ {
+ if (!t->mem_map)
+ {
+ init_empty_map(&(t->mem_map));
+ }
+ memcpy(t->mem_map + y * world.map.length, tok2, world.map.length);
+ }
+ else
{
- init_empty_map(&(t->mem_map));
+ if (!t->mem_depth_map)
+ {
+ init_empty_map(&(t->mem_depth_map));
+ }
+ memcpy(t->mem_depth_map+y*world.map.length, tok2, world.map.length);
}
- memcpy(t->mem_map + y * world.map.length, tok2, world.map.length);
}
else
{