X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/decks/%7B%7Bdeck_id%7D%7D/cards/%7B%7Bcard_id%7D%7D/static/gitweb.css?a=blobdiff_plain;f=src%2Fserver%2Fgod_commands.c;h=6eec5722d6bddcf729f9264d104a1490e9d9de5c;hb=fa0c416ccad4c4278813909ca1b799cd0600840c;hp=02c091aa548edb9e912967964eff7cb03f324227;hpb=f2b4faf81054dacf93af35b5ff1fd14d3c966a55;p=plomrogue diff --git a/src/server/god_commands.c b/src/server/god_commands.c index 02c091a..6eec572 100644 --- a/src/server/god_commands.c +++ b/src/server/god_commands.c @@ -81,7 +81,7 @@ static uint8_t parse_thingtype_manipulation(char * tok0, char * tok1) err_line(1, "No thing type defined to manipulate yet."); return 1; } - uint8_t id; + int16_t id; if ( parse_val(tok0,tok1,s[S_CMD_TT_CONSUM],'8',(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) @@ -96,7 +96,7 @@ static uint8_t parse_thingtype_manipulation(char * tok0, char * tok1) } tt->corpse_id = id; } - else if (parse_val(tok0, tok1, s[S_CMD_THINGTYPE], '8', (char *) &id)) + else if (parse_val(tok0, tok1, s[S_CMD_TT_ID], 'i', (char *) &id)) { tt = get_thing_type(id); if (!tt) @@ -135,7 +135,7 @@ static uint8_t parse_thingaction_manipulation(char * tok0, char * tok1) err_line(1, "No thing action defined to manipulate yet."); return 1; } - uint8_t id; + int16_t id; if (parse_val(tok0, tok1, s[S_CMD_TA_EFFORT],'8',(char *)&ta->effort)); else if (parse_val(tok0, tok1, s[S_CMD_TA_NAME], 's', (char *)&ta->name)) { @@ -157,7 +157,7 @@ static uint8_t parse_thingaction_manipulation(char * tok0, char * tok1) } } } - else if (parse_val(tok0, tok1, s[S_CMD_THINGACTION], 'i', (char *) &id)) + else if (parse_val(tok0, tok1, s[S_CMD_TA_ID], '8', (char *) &id)) { ta = get_thing_action(id); if (!ta) @@ -239,10 +239,9 @@ static uint8_t parse_position(char* tok0, char * tok1, struct Thing * t) { t->pos.x = length; } - free(t->fov_map); if (world.exists && t->lifepoints) { - t->fov_map = build_fov_map(t); + build_fov_map(t); } } return 1; @@ -285,7 +284,7 @@ static uint8_t parse_thing_manipulation(char * tok0, char * tok1) err_line(1, "No thing defined to manipulate yet."); return 1; } - uint8_t id; + int16_t id; if ( parse_thing_type(tok0, tok1, t) || parse_thing_command(tok0, tok1, t) || parse_val(tok0,tok1, s[S_CMD_T_ARGUMENT], '8', (char *)&t->arg) @@ -293,7 +292,7 @@ static uint8_t parse_thing_manipulation(char * tok0, char * tok1) || parse_val(tok0,tok1, s[S_CMD_T_HP], '8', (char *) &t->lifepoints) || parse_position(tok0, tok1, t) || parse_carry(tok0, tok1, t)); - else if (parse_val(tok0, tok1, s[S_CMD_THING], 'i', (char *) &id)) + else if (parse_val(tok0, tok1, s[S_CMD_T_ID], 'i', (char *) &id)) { t = get_thing(world.things, id, 1); char * err = "No thing type found to initialize new thing."; @@ -302,7 +301,7 @@ static uint8_t parse_thing_manipulation(char * tok0, char * tok1) t = add_thing(id, world.thing_types->id, 0, 0); if (world.exists && t->lifepoints) { - t->fov_map = build_fov_map(t); + build_fov_map(t); } } } @@ -371,11 +370,7 @@ static uint8_t parse_world_active(char * tok0, char * tok1) { if (ti->lifepoints) { - if (ti->fov_map) - { - free(ti->fov_map); - } - ti->fov_map = build_fov_map(ti); + build_fov_map(ti); } } world.exists = 1;