I'm having a bit of trouble with the vcmd_insert_repeated command. I added targeting to CMD_EAT so I could add a potion of dragon's breath effect to food, and I can target, but the effect doesn't fire off because the direction is always 0.
if I hit right on the keyboard, it gets direction 6 which is correct, but when it gets to this code segment, the va_arg is a bad pointer (according to visual studio), and the direction returned to the fire_beam function is always 0.
Any clue to what's mucking up the pointer?
if I hit right on the keyboard, it gets direction 6 which is correct, but when it gets to this code segment, the va_arg is a bad pointer (according to visual studio), and the direction returned to the fire_beam function is always 0.
Any clue to what's mucking up the pointer?
Code:
static errr vcmd_insert_repeated(cmd_code c, int nrepeats, va_list vp) { /* code removed for post */ for (j = 0; (game_cmds[idx].arg_type[j] != arg_END && j < N_ELEMENTS(game_cmds[idx].arg_type)); j++) { switch (game_cmds[idx].arg_type[j]) { /* code removed for post */ case arg_DIRECTION: case arg_TARGET: { cmd.args[j].direction = va_arg(vp, int); <--- bad ptr break; }
Comment