Skip to content

Commit

Permalink
Convert to SoldierID
Browse files Browse the repository at this point in the history
  • Loading branch information
Asdow committed Nov 17, 2024
1 parent 9532fbf commit f50bdf9
Show file tree
Hide file tree
Showing 22 changed files with 189 additions and 192 deletions.
36 changes: 18 additions & 18 deletions Multiplayer/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,16 +388,16 @@ typedef struct

typedef struct
{
UINT16 usSoldierID;
FLOAT dNewXPos;
FLOAT dNewYPos;
SoldierID usSoldierID;
FLOAT dNewXPos;
FLOAT dNewYPos;

} gui_pos;

typedef struct
{
UINT16 usSoldierID;
INT16 usNewDirection;
SoldierID usSoldierID;
INT16 usNewDirection;

} gui_dir;

Expand Down Expand Up @@ -425,12 +425,12 @@ typedef struct

typedef struct
{
UINT16 ubID;
SoldierID ubID;
INT8 bTeam;
UINT16 gubOutOfTurnPersons;
UINT16 gubOutOfTurnOrder[MAXMERCS];
BOOLEAN fMarkInterruptOccurred;
UINT16 Interrupted;
SoldierID Interrupted;
} INT_STRUCT;

typedef struct
Expand Down Expand Up @@ -486,7 +486,7 @@ typedef struct
float dZ;
INT32 sGridNo;
bool bWasDud;
UINT16 ubOwnerID;
SoldierID ubOwnerID;
INT32 RealObjectID; // the local ID on the initiating client
UINT32 uiPreRandomIndex; // send out our current pre-random index
} grenade_result;
Expand Down Expand Up @@ -967,7 +967,7 @@ void send_hit( EV_S_WEAPONHIT *SWeaponHit )

memcpy( &weaphit_struct , SWeaponHit, sizeof( EV_S_WEAPONHIT ));

UINT16 usSoldierID=weaphit_struct.usSoldierID;
SoldierID usSoldierID = weaphit_struct.usSoldierID;

if(SWeaponHit->usSoldierID < 20)weaphit_struct.usSoldierID = weaphit_struct.usSoldierID+ubID_prefix;
if(SWeaponHit->ubAttackerID < 20)weaphit_struct.ubAttackerID = weaphit_struct.ubAttackerID+ubID_prefix;
Expand All @@ -981,9 +981,9 @@ void recieveHIT(RPCParameters *rpcParameters)

EV_S_WEAPONHIT* SWeaponHit = (EV_S_WEAPONHIT*)rpcParameters->input;

SOLDIERTYPE *pSoldier = MercPtrs[ SWeaponHit->usSoldierID ];
UINT16 usSoldierID;
UINT16 ubAttackerID;
SOLDIERTYPE *pSoldier = SWeaponHit->usSoldierID;
SoldierID usSoldierID;
SoldierID ubAttackerID;

if((SWeaponHit->usSoldierID >= ubID_prefix) && (SWeaponHit->usSoldierID < (ubID_prefix+6))) // within our netbTeam range...
usSoldierID = (SWeaponHit->usSoldierID - ubID_prefix);
Expand Down Expand Up @@ -1157,7 +1157,7 @@ void send_gui_pos(SOLDIERTYPE *pSoldier, FLOAT dNewXPos, FLOAT dNewYPos)
{
gui_pos gnPOS;

gnPOS.usSoldierID = (pSoldier->ubID)+ubID_prefix;
gnPOS.usSoldierID = pSoldier->ubID + ubID_prefix;

gnPOS.dNewXPos = dNewXPos;
gnPOS.dNewYPos = dNewYPos;
Expand Down Expand Up @@ -1916,7 +1916,7 @@ void send_interrupt (SOLDIERTYPE *pSoldier)
memcpy(INT.gubOutOfTurnOrder, gubOutOfTurnOrder, sizeof(UINT16) * MAXMERCS);
INT.gubOutOfTurnPersons = gubOutOfTurnPersons;

INT.Interrupted=gusSelectedSoldier+ubID_prefix;
INT.Interrupted = gusSelectedSoldier + ubID_prefix;

if(INT.bTeam==0)
{
Expand Down Expand Up @@ -3030,11 +3030,11 @@ void recieveGRENADE (RPCParameters *rpcParameters)
}

// we send a grenade result out to the clients as it may have been a fizzer
void send_grenade_result (float xPos, float yPos, float zPos, INT32 sGridNo, UINT8 ubOwnerID, INT32 iRealObjectID, bool bIsDud)
void send_grenade_result (float xPos, float yPos, float zPos, INT32 sGridNo, SoldierID ubOwnerID, INT32 iRealObjectID, bool bIsDud)
{
ubOwnerID = MPEncodeSoldierID(ubOwnerID); // translate our soldier to the "network" version

SOLDIERTYPE* pSoldier = MercPtrs[ubOwnerID];
SOLDIERTYPE* pSoldier = ubOwnerID;
if (pSoldier != NULL)
{
if ((pSoldier->bTeam == 1 && is_server) || IsOurSoldier(pSoldier))
Expand Down Expand Up @@ -3343,11 +3343,11 @@ void recieveDETONATEEXPLOSIVE (RPCParameters *rpcParameters)
}
}

void send_disarm_explosive(UINT32 sGridNo, UINT32 uiWorldItem, UINT16 ubID)
void send_disarm_explosive(UINT32 sGridNo, UINT32 uiWorldItem, SoldierID ubID)
{
ubID = MPEncodeSoldierID(ubID);

SOLDIERTYPE* pSoldier = MercPtrs[ubID];
SOLDIERTYPE* pSoldier = ubID;
if (pSoldier != NULL)
{
// explosive disarmed on this client, notify the other clients
Expand Down
6 changes: 3 additions & 3 deletions Multiplayer/connect.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@ void send_interrupt(SOLDIERTYPE *pSoldier);

// OJW - 20091002 - explosives
void send_grenade (OBJECTTYPE *pGameObj, float dLifeLength, float xPos, float yPos, float zPos, float xForce, float yForce, float zForce, UINT32 sTargetGridNo, UINT16 ubOwner, UINT8 ubActionCode, UINT32 uiActionData, INT32 iRealObjectID, bool bIsThrownGrenade);
void send_grenade_result (float xPos, float yPos, float zPos, INT32 sGridNo, UINT8 ubOwnerID, INT32 iRealObjectID, bool bIsDud);
void send_grenade_result (float xPos, float yPos, float zPos, INT32 sGridNo, SoldierID ubOwnerID, INT32 iRealObjectID, bool bIsDud);
void send_plant_explosive (UINT16 ubID,UINT16 usItem,UINT8 ubItemStatus,UINT16 usFlags, UINT32 sGridNo,UINT8 ubLevel, UINT32 uiWorldIndex);
void send_detonate_explosive (UINT32 uiWorldIndex, UINT16 ubID);
void send_spreadeffect ( INT32 sGridNo, UINT8 ubRadius, UINT16 usItem, UINT16 ubOwner, BOOLEAN fSubsequent, INT8 bLevel, INT32 iSmokeEffectID );
void send_newsmokeeffect(INT32 sGridNo, UINT16 usItem, INT8 bLevel, UINT16 ubOwner, INT32 iSmokeEffectID);
void send_gasdamage( SOLDIERTYPE * pSoldier, UINT16 usExplosiveClassID, INT16 sSubsequent, BOOLEAN fRecompileMovementCosts, INT16 sWoundAmt, INT16 sBreathAmt, SoldierID ubOwner );
void send_explosivedamage( UINT16 ubPerson, UINT16 ubOwner, INT32 sBombGridNo, INT16 sWoundAmt, INT16 sBreathAmt, UINT32 uiDist, UINT16 usItem, INT16 sSubsequent );
void send_disarm_explosive(UINT32 sGridNo, UINT32 uiWorldIndex, UINT16 ubID);
void send_disarm_explosive(UINT32 sGridNo, UINT32 uiWorldIndex, SoldierID ubID);

void OpenChatMsgBox(void);

Expand Down Expand Up @@ -211,7 +211,7 @@ extern BOOLEAN fClientReceivedAllFiles;
// sick of confusing myself :)

// this one should be called before passing an ID off the client
inline UINT16 MPEncodeSoldierID( UINT16 ubID )
inline SoldierID MPEncodeSoldierID( SoldierID ubID )
{
if ( ubID < 20 )
return ubID + ubID_prefix; // soldier is ours
Expand Down
4 changes: 2 additions & 2 deletions Strategic/LuaInitNPCs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2717,7 +2717,7 @@ void LuaHandleSectorLiberation( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ, B

void LuaHandleInteractiveActionResult( INT16 sSectorX, INT16 sSectorY,
INT8 bSectorZ,
INT32 sGridNo, UINT8 bLevel, UINT16 ubId,
INT32 sGridNo, UINT8 bLevel, SoldierID ubId,
UINT16 usActionType, INT32 sLuaactionid, INT32 difficulty, UINT16 skill )
{
const char* filename = "scripts\\Overhead.lua";
Expand All @@ -2731,7 +2731,7 @@ void LuaHandleInteractiveActionResult( INT16 sSectorX, INT16 sSectorY,

SGP_THROW_IFFALSE( _LS.L.EvalFile( filename ), _BS( "Cannot open file: " ) << filename << _BS::cget );

LuaFunction( _LS.L, "HandleInteractiveActionResult" ).Param<int>( sSectorX ).Param<int>( sSectorY ).Param<int>( bSectorZ ).Param<int>( sGridNo ).Param<int>( bLevel ).Param<int>( ubId ).Param<int>( usActionType ).Param<int>( sLuaactionid ).Param<int>( difficulty ).Param<int>( skill ).Call( 10 );
LuaFunction( _LS.L, "HandleInteractiveActionResult" ).Param<int>( sSectorX ).Param<int>( sSectorY ).Param<int>( bSectorZ ).Param<int>( sGridNo ).Param<int>( bLevel ).Param<int>( ubId.i ).Param<int>( usActionType ).Param<int>( sLuaactionid ).Param<int>( difficulty ).Param<int>( skill ).Call( 10 );
}

void LuaRecruitRPCAdditionalHandling( UINT8 usProfile )
Expand Down
2 changes: 1 addition & 1 deletion Strategic/LuaInitNPCs.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ extern BOOLEAN LuaHandleQuestCodeOnSector( INT16 sSectorX, INT16 sSectorY, INT8
void LuaHandleSectorLiberation( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ, BOOLEAN fFirstTime );
void LuaHandleInteractiveActionResult( INT16 sSectorX, INT16 sSectorY,
INT8 bSectorZ,
INT32 sGridNo, UINT8 bLevel, UINT16 ubId,
INT32 sGridNo, UINT8 bLevel, SoldierID ubId,
UINT16 usActionType, INT32 sLuaactionid, INT32 difficulty, UINT16 skill );
void LuaRecruitRPCAdditionalHandling( UINT8 usProfile );
void LuaHandleSectorTacticalEntry( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ, BOOLEAN fHasEverBeenPlayerControlled );
Expand Down
4 changes: 2 additions & 2 deletions Tactical/Faces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2087,10 +2087,10 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
// Flugente: are we supplying ammo to someone else?
if (gGameExternalOptions.ubExternalFeeding > 0)
{
UINT16 ubID1 = 0;
SoldierID ubID1 = NOBODY;
UINT16 ubGunSlot1 = 0;
UINT16 ubFaceSlot1 = 0;
UINT16 ubID2 = 0;
SoldierID ubID2 = NOBODY;
UINT16 ubGunSlot2 = 0;
UINT16 ubFaceSlot2 = 0;
if (pSoldier->IsFeedingExternal(&ubID1, &ubGunSlot1, &ubFaceSlot1, &ubID2, &ubGunSlot2, &ubFaceSlot2))
Expand Down
86 changes: 41 additions & 45 deletions Tactical/Handle Items.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,20 +239,20 @@ BOOLEAN HandleCheckForBadChangeToGetThrough( SOLDIERTYPE *pSoldier, SOLDIERTYPE

INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHandItem, BOOLEAN fFromUI )
{
SOLDIERTYPE *pTargetSoldier = NULL;
UINT16 usSoldierIndex;
INT32 sTargetGridNo;
INT16 sAPCost;
INT32 sActionGridNo;
UINT8 ubDirection = 0;
INT32 sAdjustedGridNo;
BOOLEAN fDropBomb = FALSE;
BOOLEAN fAddingTurningCost = FALSE;
BOOLEAN fAddingRaiseGunCost = FALSE;
LEVELNODE *pIntNode;
STRUCTURE *pStructure;
UINT16 usRaiseGunCost = 0;
UINT16 usTurningCost = 0;
SOLDIERTYPE *pTargetSoldier = NULL;
SoldierID usSoldierIndex;
INT32 sTargetGridNo;
INT16 sAPCost;
INT32 sActionGridNo;
UINT8 ubDirection = 0;
INT32 sAdjustedGridNo;
BOOLEAN fDropBomb = FALSE;
BOOLEAN fAddingTurningCost = FALSE;
BOOLEAN fAddingRaiseGunCost = FALSE;
LEVELNODE *pIntNode;
STRUCTURE *pStructure;
UINT16 usRaiseGunCost = 0;
UINT16 usTurningCost = 0;

//shadooow: automatically close EDB when opened and trying to use any weapon or action
if (gfInItemDescBox)
Expand All @@ -277,7 +277,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
//if ( FindSoldier( sGridNo, &usSoldierIndex, &uiMercFlags, FIND_SOLDIER_GRIDNO ) )
if ( ( usSoldierIndex = WhoIsThere2( sGridNo, bLevel ) ) != NOBODY )
{
pTargetSoldier = MercPtrs[ usSoldierIndex ];
pTargetSoldier = usSoldierIndex;

// anv: don't try to heal interactive spots
if (fFromUI && Item[usHandItem].usItemClass != IC_MEDKIT)
Expand Down Expand Up @@ -1394,11 +1394,11 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
}
}

UINT16 ubPerson = WhoIsThere2(usMapPos, pSoldier->pathing.bLevel);
SoldierID ubPerson = WhoIsThere2(usMapPos, pSoldier->pathing.bLevel);

// Flugente: apply misc items to other soldiers
// sevenfm: check that target soldier is visible
if (ItemCanBeAppliedToOthers(usHandItem) && ubPerson != NOBODY && MercPtrs[ubPerson] && MercPtrs[ubPerson]->bVisible != 0)
if (ItemCanBeAppliedToOthers(usHandItem) && ubPerson != NOBODY && ubPerson->bVisible != 0)
{
// ATE: AI CANNOT GO THROUGH HERE!
BOOLEAN fHadToUseCursorPos = FALSE;
Expand Down Expand Up @@ -4292,9 +4292,8 @@ BOOLEAN DrawItemPoolList( ITEM_POOL *pItemPool, INT32 sGridNo, UINT8 bCommand, I
if (gGameExternalOptions.gfShowBackpackOwner &&
Item[gWorldItems[pItemPool->iItemIndex].object.usItem].usItemClass == IC_LBEGEAR &&
LoadBearingEquipment[Item[gWorldItems[pItemPool->iItemIndex].object.usItem].ubClassIndex].lbeClass == BACKPACK &&
gWorldItems[pItemPool->iItemIndex].soldierID != NOBODY &&
MercPtrs[gWorldItems[pItemPool->iItemIndex].soldierID])
swprintf(pStr, L"%s (%d) (%s)", ShortItemNames[gWorldItems[pTempItemPool->iItemIndex].object.usItem], gWorldItems[pTempItemPool->iItemIndex].object.ubNumberOfObjects, MercPtrs[gWorldItems[pItemPool->iItemIndex].soldierID]->GetName());
gWorldItems[pItemPool->iItemIndex].soldierID != NOBODY)
swprintf(pStr, L"%s (%d) (%s)", ShortItemNames[gWorldItems[pTempItemPool->iItemIndex].object.usItem], gWorldItems[pTempItemPool->iItemIndex].object.ubNumberOfObjects, gWorldItems[pItemPool->iItemIndex].soldierID->GetName());
else
swprintf( pStr, L"%s (%d)", ShortItemNames[ gWorldItems[ pTempItemPool->iItemIndex ].object.usItem ], gWorldItems[ pTempItemPool->iItemIndex ].object.ubNumberOfObjects );
}
Expand All @@ -4303,9 +4302,8 @@ BOOLEAN DrawItemPoolList( ITEM_POOL *pItemPool, INT32 sGridNo, UINT8 bCommand, I
if (gGameExternalOptions.gfShowBackpackOwner &&
Item[gWorldItems[pItemPool->iItemIndex].object.usItem].usItemClass == IC_LBEGEAR &&
LoadBearingEquipment[Item[gWorldItems[pItemPool->iItemIndex].object.usItem].ubClassIndex].lbeClass == BACKPACK &&
gWorldItems[pItemPool->iItemIndex].soldierID != NOBODY &&
MercPtrs[gWorldItems[pItemPool->iItemIndex].soldierID])
swprintf(pStr, L"%s (%s)", ShortItemNames[gWorldItems[pTempItemPool->iItemIndex].object.usItem], MercPtrs[gWorldItems[pItemPool->iItemIndex].soldierID]->GetName());
gWorldItems[pItemPool->iItemIndex].soldierID != NOBODY)
swprintf(pStr, L"%s (%s)", ShortItemNames[gWorldItems[pTempItemPool->iItemIndex].object.usItem], gWorldItems[pItemPool->iItemIndex].soldierID->GetName());
else
swprintf( pStr, L"%s", ShortItemNames[ gWorldItems[ pTempItemPool->iItemIndex ].object.usItem ] );
}
Expand Down Expand Up @@ -4413,9 +4411,8 @@ BOOLEAN DrawItemPoolList( ITEM_POOL *pItemPool, INT32 sGridNo, UINT8 bCommand, I
if (gGameExternalOptions.gfShowBackpackOwner &&
Item[gWorldItems[pItemPool->iItemIndex].object.usItem].usItemClass == IC_LBEGEAR &&
LoadBearingEquipment[Item[gWorldItems[pItemPool->iItemIndex].object.usItem].ubClassIndex].lbeClass == BACKPACK &&
gWorldItems[pItemPool->iItemIndex].soldierID != NOBODY &&
MercPtrs[gWorldItems[pItemPool->iItemIndex].soldierID])
swprintf(pStr, L"%s (%d) (%s)", ShortItemNames[gWorldItems[pItemPool->iItemIndex].object.usItem], gWorldItems[pItemPool->iItemIndex].object.ubNumberOfObjects, MercPtrs[gWorldItems[pItemPool->iItemIndex].soldierID]->GetName());
gWorldItems[pItemPool->iItemIndex].soldierID != NOBODY)
swprintf(pStr, L"%s (%d) (%s)", ShortItemNames[gWorldItems[pItemPool->iItemIndex].object.usItem], gWorldItems[pItemPool->iItemIndex].object.ubNumberOfObjects, gWorldItems[pItemPool->iItemIndex].soldierID->GetName());
else
swprintf( pStr, L"%s (%d)", ShortItemNames[ gWorldItems[ pItemPool->iItemIndex ].object.usItem ], gWorldItems[ pItemPool->iItemIndex ].object.ubNumberOfObjects );
}
Expand All @@ -4424,9 +4421,8 @@ BOOLEAN DrawItemPoolList( ITEM_POOL *pItemPool, INT32 sGridNo, UINT8 bCommand, I
if (gGameExternalOptions.gfShowBackpackOwner &&
Item[gWorldItems[pItemPool->iItemIndex].object.usItem].usItemClass == IC_LBEGEAR &&
LoadBearingEquipment[Item[gWorldItems[pItemPool->iItemIndex].object.usItem].ubClassIndex].lbeClass == BACKPACK &&
gWorldItems[pItemPool->iItemIndex].soldierID != NOBODY &&
MercPtrs[gWorldItems[pItemPool->iItemIndex].soldierID])
swprintf(pStr, L"%s (%s)", ShortItemNames[gWorldItems[pItemPool->iItemIndex].object.usItem], MercPtrs[gWorldItems[pItemPool->iItemIndex].soldierID]->GetName());
gWorldItems[pItemPool->iItemIndex].soldierID != NOBODY)
swprintf(pStr, L"%s (%s)", ShortItemNames[gWorldItems[pItemPool->iItemIndex].object.usItem], gWorldItems[pItemPool->iItemIndex].soldierID->GetName());
else
swprintf( pStr, L"%s", ShortItemNames[ gWorldItems[ pItemPool->iItemIndex ].object.usItem ] );
}
Expand Down Expand Up @@ -4814,12 +4810,12 @@ void RenderTopmostFlashingItems( )
BOOLEAN VerifyGiveItem( SOLDIERTYPE *pSoldier, SOLDIERTYPE **ppTargetSoldier )
{
SOLDIERTYPE *pTSoldier;
UINT16 usSoldierIndex;
SoldierID usSoldierIndex;
OBJECTTYPE *pObject;

INT32 sGridNo;
UINT8 ubDirection;
UINT16 ubTargetMercID;
UINT8 ubDirection;
SoldierID ubTargetMercID;

// DO SOME CHECKS IF WE CAN DO ANIMATION.....

Expand All @@ -4828,7 +4824,7 @@ BOOLEAN VerifyGiveItem( SOLDIERTYPE *pSoldier, SOLDIERTYPE **ppTargetSoldier )

sGridNo = pSoldier->aiData.sPendingActionData2;
ubDirection = pSoldier->aiData.bPendingActionData3;
ubTargetMercID = (UINT16)pSoldier->aiData.uiPendingActionData4;
ubTargetMercID = static_cast<UINT16>( pSoldier->aiData.uiPendingActionData4 );

usSoldierIndex = WhoIsThere2( sGridNo, pSoldier->pathing.bLevel );

Expand Down Expand Up @@ -4864,7 +4860,7 @@ BOOLEAN VerifyGiveItem( SOLDIERTYPE *pSoldier, SOLDIERTYPE **ppTargetSoldier )

if ( ubTargetMercID != NOBODY )
{
MercPtrs[ ubTargetMercID ]->flags.uiStatusFlags &= (~SOLDIER_ENGAGEDINACTION );
ubTargetMercID->flags.uiStatusFlags &= (~SOLDIER_ENGAGEDINACTION );
}

OBJECTTYPE::DeleteMe( &pSoldier->pTempObject );
Expand Down Expand Up @@ -5078,13 +5074,13 @@ void SoldierGiveItemFromAnimation( SOLDIERTYPE *pSoldier )

INT32 AdjustGridNoForItemPlacement( SOLDIERTYPE *pSoldier, INT32 sGridNo )
{
STRUCTURE *pStructure;
INT16 sDesiredLevel;
INT32 sActionGridNo;
BOOLEAN fStructFound = FALSE;
UINT8 ubDirection;
INT32 sAdjustedGridNo;
UINT16 ubTargetID;
STRUCTURE *pStructure;
INT16 sDesiredLevel;
INT32 sActionGridNo;
BOOLEAN fStructFound = FALSE;
UINT8 ubDirection;
INT32 sAdjustedGridNo;
SoldierID ubTargetID;


sActionGridNo = sGridNo;
Expand Down Expand Up @@ -9405,11 +9401,11 @@ void DoInteractiveAction( INT32 sGridNo, SOLDIERTYPE *pSoldier )

// handle the default result of an interactive action
// This is called either if no lua action id is set, or by lua if this should happen as a supplement to whatever lua does
void DoInteractiveActionDefaultResult( INT32 sGridNo, UINT16 ubID, BOOLEAN aSuccess )
void DoInteractiveActionDefaultResult( INT32 sGridNo, SoldierID ubID, BOOLEAN aSuccess )
{
SOLDIERTYPE* pSoldier = NULL;
if ( ubID != NOBODY )
pSoldier = MercPtrs[ubID];
pSoldier = ubID;

// we need a valid soldier and a valid object
if ( !pSoldier )
Expand Down Expand Up @@ -10457,9 +10453,9 @@ void TakePhoto(SOLDIERTYPE* pSoldier, INT32 sGridNo, INT8 bLevel )
InARoom( newgridno, &room );

// check if there is someone here
UINT16 ubid = WhoIsThere2( newgridno, bLevel );
SoldierID ubid = WhoIsThere2( newgridno, bLevel );

LuaAddPhotoData( gWorldSectorX, gWorldSectorY, gbWorldSectorZ, newgridno, bLevel, pSoldier->ubProfile, room, ( ubid == NOBODY ) ? NO_PROFILE : MercPtrs[ubid]->ubProfile );
LuaAddPhotoData( gWorldSectorX, gWorldSectorY, gbWorldSectorZ, newgridno, bLevel, pSoldier->ubProfile, room, ( ubid == NOBODY ) ? NO_PROFILE : ubid->ubProfile );
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Tactical/Handle Items.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ extern ITEM_POOL *gpItemPool;//dnl ch26 210909

// Flugente: interactive actions
void DoInteractiveAction( INT32 sGridNo, SOLDIERTYPE *pSoldier );
void DoInteractiveActionDefaultResult( INT32 sGridNo, UINT16 ubID, BOOLEAN aSuccess );
void DoInteractiveActionDefaultResult( INT32 sGridNo, SoldierID ubID, BOOLEAN aSuccess );
BOOLEAN SpendMoney( SOLDIERTYPE *pSoldier, UINT32 aAmount ); // character spends money - either from inventory or the account

// Flugente: intel
Expand Down
Loading

0 comments on commit f50bdf9

Please sign in to comment.