From: Christian Heller Date: Thu, 24 Jul 2014 02:35:46 +0000 (+0200) Subject: Server: Fix buggy handling of ID sizes in TT_ID/TA_ID/T_ID commands. X-Git-Tag: tce~693 X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/static/%7B%7B%20web_path%20%7D%7D/decks/%7B%7Btodo.date%7D%7D?a=commitdiff_plain;h=1c7d2240c874aa6697d99b0fb058ac490db8c414;p=plomrogue Server: Fix buggy handling of ID sizes in TT_ID/TA_ID/T_ID commands. --- diff --git a/src/server/god_commands.c b/src/server/god_commands.c index 2962d4c..b0aa86a 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_TT_ID], '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)) { @@ -285,7 +285,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)