Please use setDroidActionTarget() whenever you change psActionTarget. This helps set dangling pointer debugging information.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7262 4a71c877-e1ca-e34f-864e-861f7616d084
master
Per Inge Mathisen 2009-05-01 09:42:42 +00:00 committed by Git SVN Gateway
parent d18d80f979
commit 7bea80efd3
3 changed files with 7 additions and 9 deletions

View File

@ -737,8 +737,8 @@ static const struct
SDL_Cursor* init_system_cursor16(CURSOR cur)
{
int i, row, col;
Uint8 data[4 * 16];
Uint8 mask[4 * 16];
uint8_t data[4 * 16];
uint8_t mask[4 * 16];
int hot_x, hot_y;
const char** image;
ASSERT(cur < CURSOR_MAX, "Attempting to load non-existent cursor: %u", (unsigned int)cur);
@ -777,4 +777,3 @@ SDL_Cursor* init_system_cursor16(CURSOR cur)
sscanf(image[4 + row], "%d,%d", &hot_x, &hot_y);
return SDL_CreateCursor(data, mask, 16, 16, hot_x, hot_y);
}

View File

@ -1137,8 +1137,8 @@ static const struct
SDL_Cursor* init_system_cursor32(CURSOR cur)
{
int i, row, col;
Uint8 data[4 * 32];
Uint8 mask[4 * 32];
uint8_t data[4 * 32];
uint8_t mask[4 * 32];
int hot_x, hot_y;
const char** image;
ASSERT(cur < CURSOR_MAX, "Attempting to load non-existent cursor: %u", (unsigned int)cur);
@ -1180,4 +1180,3 @@ SDL_Cursor* init_system_cursor32(CURSOR cur)
sscanf(image[4 + row], "%d,%d", &hot_x, &hot_y);
return SDL_CreateCursor(data, mask, 32, 32, hot_x, hot_y);
}

View File

@ -1471,7 +1471,7 @@ void actionUpdateDroid(DROID *psDroid)
if (psDroid->psActionTarget[i] != psDroid->psActionTarget[0])
{
// Nope, can't shoot this, try something else next time
psDroid->psActionTarget[i] = NULL;
setDroidActionTarget(psDroid, NULL, i);
}
}
else if (psDroid->sMove.Status != MOVESHUFFLE)
@ -1490,13 +1490,13 @@ void actionUpdateDroid(DROID *psDroid)
else if (i > 0)
{
// Nope, can't shoot this, try something else next time
psDroid->psActionTarget[i] = NULL;
setDroidActionTarget(psDroid, NULL, i);
}
}
else if (i > 0)
{
// Nope, can't shoot this, try something else next time
psDroid->psActionTarget[i] = NULL;
setDroidActionTarget(psDroid, NULL, i);
}
}