Mercurial > MadButterfly
comparison src/shape_path.c @ 1165:9f2b5a1a0d84
Fix bug of unpredicatible output of tank.
- This issue was reported by an Ali guy. He find tank would generate
unpredicatible output when playing a boom.
- rdman_shape_path_new_from_binary() does not copy zero byte (\x00)
of command string. It is requested by sh_path_path() to detect end
of command string.
- Fixed by coping zero byte.
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Wed, 29 Dec 2010 14:58:06 +0800 |
parents | bd0cfb8666b8 |
children | bae104d8d247 |
comparison
equal
deleted
inserted
replaced
1164:2cb5047d8f2b | 1165:9f2b5a1a0d84 |
---|---|
1188 elmpool_elm_free(rdman->sh_path_pool, path); | 1188 elmpool_elm_free(rdman->sh_path_pool, path); |
1189 return NULL; | 1189 return NULL; |
1190 } | 1190 } |
1191 | 1191 |
1192 path->dev_data = path->user_data + msz; | 1192 path->dev_data = path->user_data + msz; |
1193 memcpy(path->user_data, commands, strlen(commands)); | 1193 memcpy(path->user_data, commands, strlen(commands) + 1); |
1194 memcpy(path->user_data + cmd_cnt, pnts, sizeof(co_aix) * pnt_cnt); | 1194 memcpy(path->user_data + cmd_cnt, pnts, sizeof(co_aix) * pnt_cnt); |
1195 memcpy(path->user_data + cmd_cnt + pnt_cnt * sizeof(co_aix), | 1195 memcpy(path->user_data + cmd_cnt + pnt_cnt * sizeof(co_aix), |
1196 float_args, sizeof(co_aix) * float_arg_cnt); | 1196 float_args, sizeof(co_aix) * float_arg_cnt); |
1197 memcpy(path->dev_data, path->user_data, msz); | 1197 memcpy(path->dev_data, path->user_data, msz); |
1198 | 1198 |