improved the error reporting of the network unpacker

This commit is contained in:
Magnus Auvinen 2008-12-19 11:25:14 +00:00
parent 530dace4c9
commit 5e3f740220

View file

@ -217,9 +217,9 @@ if gen_network_source:
lines += ['{'] lines += ['{']
lines += ['\tvoid *msg;'] lines += ['\tvoid *msg;']
lines += ['\tmsg_failed_on = "";'] lines += ['\tmsg_failed_on = "";']
lines += ['\tif(type < 0 || type >= NUM_NETMSGTYPES) return 0;'] lines += ['\tif(type < 0 || type >= NUM_NETMSGTYPES) { msg_failed_on = "(type out of range)"; return 0; }']
lines += ['\tmsg = secure_unpack_funcs[type]();'] lines += ['\tmsg = secure_unpack_funcs[type]();']
lines += ['\tif(msg_unpack_error()) return 0;'] lines += ['\tif(msg_unpack_error()) { msg_failed_on = "(unpack error)"; return 0; }']
lines += ['\treturn msg;'] lines += ['\treturn msg;']
lines += ['};'] lines += ['};']
lines += [''] lines += ['']