mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
Use SoldierID instead of pSoldier
ContinueDialogue was possible to be called with pSoldier that isn't null but is not valid pointer to MercPtrs array resulting in debugger catching an illegal memory access.
This commit is contained in:
@@ -863,7 +863,7 @@ extern BOOLEAN CanPlayerUseSectorInventory( SOLDIERTYPE *pSelectedSoldier );
|
||||
|
||||
// handle talking
|
||||
void HandleSpontanousTalking( void );
|
||||
BOOLEAN ContinueDialogue(SOLDIERTYPE *pSoldier, BOOLEAN fDone );
|
||||
BOOLEAN ContinueDialogue(SoldierID id, BOOLEAN fDone );
|
||||
extern void CreateDestroyMilitiaSectorButtons( void );
|
||||
extern void CreateDestroySupplySectorButtons();
|
||||
|
||||
@@ -13098,17 +13098,13 @@ void UpdatePausedStatesDueToTimeCompression( void )
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN ContinueDialogue(SOLDIERTYPE *pSoldier, BOOLEAN fDone )
|
||||
BOOLEAN ContinueDialogue(SoldierID id, BOOLEAN fDone )
|
||||
{
|
||||
// continue this grunts dialogue, restore when done
|
||||
static INT16 bOldSelectedInfoChar = -1;
|
||||
static BOOLEAN fTalkingingGuy = FALSE;
|
||||
|
||||
UINT16 bCounter = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
if( fDone == TRUE )
|
||||
{
|
||||
if( fTalkingingGuy == TRUE )
|
||||
@@ -13131,7 +13127,7 @@ BOOLEAN ContinueDialogue(SOLDIERTYPE *pSoldier, BOOLEAN fDone )
|
||||
}
|
||||
|
||||
// check if valid character talking?
|
||||
if( pSoldier == NULL )
|
||||
if( id >= NOBODY )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
@@ -13141,7 +13137,7 @@ BOOLEAN ContinueDialogue(SOLDIERTYPE *pSoldier, BOOLEAN fDone )
|
||||
{
|
||||
if( gCharactersList[bCounter].fValid == TRUE )
|
||||
{
|
||||
if( gCharactersList[bCounter].usSolID == pSoldier->ubID )
|
||||
if( gCharactersList[bCounter].usSolID == id )
|
||||
{
|
||||
if( bSelectedInfoChar != bCounter )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user