Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old August 24, 2010, 05:26   #1
Sirridan
Knight
 
Sirridan's Avatar
 
Join Date: May 2009
Posts: 560
Sirridan is on a distinguished road
Bad pointer in vcmd_insert_repeated

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?

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;
			}
Sirridan is offline   Reply With Quote
Old August 24, 2010, 19:11   #2
Sirridan
Knight
 
Sirridan's Avatar
 
Join Date: May 2009
Posts: 560
Sirridan is on a distinguished road
I'm dumb, sorry for the bad thread. I didn't edit the command list properly so the game knew to look for a target command when eating, fixed that though. All is well
Sirridan is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
The Official Bad Advice Thread steeg1234321 Vanilla 158 October 24, 2011 19:56
Bad memory read jbu Development 1 August 14, 2010 14:57
Selling bad weapons z118 Vanilla 10 February 14, 2010 12:02
Drats! Bad Unique Drops! dhegler Vanilla 25 December 31, 2009 22:07
Equipment? And how bad is aggravation? fmackenz Vanilla 3 November 1, 2008 10:21


All times are GMT +1. The time now is 09:09.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.