mirror of
https://github.com/1dot13/source.git
synced 2026-08-26 14:30:26 +02:00
AddSoldierToSector & OBJECTTYPE::soldierID changed to SoldierID
This commit is contained in:
@@ -4292,7 +4292,7 @@ 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 != -1 &&
|
||||
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());
|
||||
else
|
||||
@@ -4303,7 +4303,7 @@ 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 != -1 &&
|
||||
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());
|
||||
else
|
||||
@@ -4413,7 +4413,7 @@ 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 != -1 &&
|
||||
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());
|
||||
else
|
||||
@@ -4424,7 +4424,7 @@ 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 != -1 &&
|
||||
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());
|
||||
else
|
||||
|
||||
@@ -11478,7 +11478,7 @@ void RenderItemPickupMenu( )
|
||||
!gfStealing &&
|
||||
Item[gWorldItems[gItemPickupMenu.ItemPoolSlots[cnt]->iItemIndex].object.usItem].usItemClass == IC_LBEGEAR &&
|
||||
LoadBearingEquipment[Item[gWorldItems[gItemPickupMenu.ItemPoolSlots[cnt]->iItemIndex].object.usItem].ubClassIndex].lbeClass == BACKPACK &&
|
||||
gWorldItems[gItemPickupMenu.ItemPoolSlots[cnt]->iItemIndex].soldierID != -1 &&
|
||||
gWorldItems[gItemPickupMenu.ItemPoolSlots[cnt]->iItemIndex].soldierID != NOBODY &&
|
||||
MercPtrs[gWorldItems[gItemPickupMenu.ItemPoolSlots[cnt]->iItemIndex].soldierID])
|
||||
//swprintf(pStr, L"%s (%s)", ShortItemNames[pObject->usItem], MercPtrs[gWorldItems[gItemPickupMenu.ItemPoolSlots[cnt]->iItemIndex].soldierID]->GetName());
|
||||
swprintf(pStr, L"(%s)", MercPtrs[gWorldItems[gItemPickupMenu.ItemPoolSlots[cnt]->iItemIndex].soldierID]->GetName());
|
||||
|
||||
@@ -4209,7 +4209,7 @@ BOOLEAN ChangeDropPackStatus(SOLDIERTYPE *pSoldier, BOOLEAN newStatus)
|
||||
{
|
||||
if(gWorldItems[wi].soldierID == pSoldier->ubID)
|
||||
{
|
||||
gWorldItems[wi].soldierID = -1;
|
||||
gWorldItems[wi].soldierID = NOBODY;
|
||||
}
|
||||
}
|
||||
MoveItemToLBEItem( pSoldier, BPACKPOCKPOS );
|
||||
@@ -4231,7 +4231,7 @@ BOOLEAN ChangeDropPackStatus(SOLDIERTYPE *pSoldier, BOOLEAN newStatus)
|
||||
//CHRISL: There's the remote chance that a non-LBE item might get associated with a merc. If that happens, we can
|
||||
// have a CTD, so lets resolve that here.
|
||||
if(Item[gWorldItems[wi].object.usItem].usItemClass != IC_LBEGEAR)
|
||||
gWorldItems[wi].soldierID = -1;
|
||||
gWorldItems[wi].soldierID = NOBODY;
|
||||
if(gWorldItems[wi].soldierID == pSoldier->ubID && gWorldItems[wi].fExists == TRUE && Item[gWorldItems[wi].object.usItem].usItemClass == IC_LBEGEAR && LoadBearingEquipment[Item[gWorldItems[wi].object.usItem].ubClassIndex].lbeClass == BACKPACK)
|
||||
{
|
||||
for (int x = 0; x < gWorldItems[wi].object.ubNumberOfObjects; ++x) {
|
||||
|
||||
@@ -3901,7 +3901,7 @@ void MoveOneMilitiaEquipmentSet(INT16 sSourceX, INT16 sSourceY, INT16 sTargetX,
|
||||
pWorldItem_tmp[uiCount].usFlags = WORLD_ITEM_REACHABLE;
|
||||
pWorldItem_tmp[uiCount].bVisible = 1;
|
||||
pWorldItem_tmp[uiCount].bRenderZHeightAboveLevel = 0;
|
||||
pWorldItem_tmp[uiCount].soldierID = -1;
|
||||
pWorldItem_tmp[uiCount].soldierID = NOBODY;
|
||||
pWorldItem_tmp[uiCount].object = tmp.Inv[ i ];
|
||||
}
|
||||
}
|
||||
@@ -4647,7 +4647,7 @@ void TakeMilitiaEquipmentfromSector( INT16 sMapX, INT16 sMapY, INT8 sMapZ, SOLDI
|
||||
pWorldItem[uiCount].usFlags = WORLD_ITEM_REACHABLE;
|
||||
pWorldItem[uiCount].bVisible = 1;
|
||||
pWorldItem[uiCount].bRenderZHeightAboveLevel = 0;
|
||||
pWorldItem[uiCount].soldierID = -1;
|
||||
pWorldItem[uiCount].soldierID = NOBODY;
|
||||
pWorldItem[uiCount].object = newAmmoObj;
|
||||
|
||||
fNewMagCreated = FALSE;
|
||||
@@ -4686,7 +4686,7 @@ void TakeMilitiaEquipmentfromSector( INT16 sMapX, INT16 sMapY, INT8 sMapZ, SOLDI
|
||||
pWorldItem_tmp[uiCount].usFlags = WORLD_ITEM_REACHABLE;
|
||||
pWorldItem_tmp[uiCount].bVisible = 1;
|
||||
pWorldItem_tmp[uiCount].bRenderZHeightAboveLevel = 0;
|
||||
pWorldItem_tmp[uiCount].soldierID = -1;
|
||||
pWorldItem_tmp[uiCount].soldierID = NOBODY;
|
||||
pWorldItem_tmp[uiCount].object = newAmmoObj;
|
||||
|
||||
fNewMagCreated = FALSE;
|
||||
|
||||
@@ -1135,17 +1135,16 @@ INT32 FindRandomGridNoBetweenCircles( INT32 sCenterGridNo, UINT8 uInnerRadius, U
|
||||
return(sGridNo);
|
||||
}
|
||||
|
||||
BOOLEAN InternalAddSoldierToSector(UINT16 ubID, BOOLEAN fCalculateDirection, BOOLEAN fUseAnimation, UINT16 usAnimState, UINT16 usAnimCode )
|
||||
BOOLEAN InternalAddSoldierToSector(SoldierID ubID, BOOLEAN fCalculateDirection, BOOLEAN fUseAnimation, UINT16 usAnimState, UINT16 usAnimCode )
|
||||
{
|
||||
UINT8 ubDirection = 0;
|
||||
UINT8 ubCalculatedDirection = 0;
|
||||
SOLDIERTYPE *pSoldier = 0;
|
||||
INT32 sGridNo = NOWHERE;
|
||||
INT32 sExitGridNo = NOWHERE;
|
||||
UINT8 ubDirection = 0;
|
||||
UINT8 ubCalculatedDirection = 0;
|
||||
INT32 sGridNo = NOWHERE;
|
||||
INT32 sExitGridNo = NOWHERE;
|
||||
|
||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("InternalAddSoldierToSector"));
|
||||
|
||||
pSoldier = MercPtrs[ ubID ];
|
||||
SOLDIERTYPE *pSoldier = ubID;
|
||||
|
||||
if ( pSoldier->bActive )
|
||||
{
|
||||
@@ -1332,7 +1331,7 @@ BOOLEAN InternalAddSoldierToSector(UINT16 ubID, BOOLEAN fCalculateDirection, BOO
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
BOOLEAN AddSoldierToSector( UINT16 ubID )
|
||||
BOOLEAN AddSoldierToSector( SoldierID ubID )
|
||||
{
|
||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("AddSoldierToSector"));
|
||||
return( InternalAddSoldierToSector( ubID, TRUE, FALSE, 0 , 0) );
|
||||
|
||||
@@ -30,7 +30,7 @@ INT32 FindRandomGridNoBetweenCircles( INT32 sCenterGridNo, UINT8 uInnerRadius, U
|
||||
|
||||
// Adds a soldier ( already created in mercptrs[] array )!
|
||||
// Finds a good placement based on data in the loaded sector and if they are enemy's or not, etc...
|
||||
BOOLEAN AddSoldierToSector( UINT16 ubID );
|
||||
BOOLEAN AddSoldierToSector( SoldierID ubID );
|
||||
|
||||
BOOLEAN AddSoldierToSectorNoCalculateDirection( UINT16 ubID );
|
||||
|
||||
|
||||
@@ -256,7 +256,7 @@ void WORLDITEM::initialize()
|
||||
this->bRenderZHeightAboveLevel = 0;
|
||||
this->bVisible = 0;
|
||||
this->ubNonExistChance = 0;
|
||||
this->soldierID = -1;
|
||||
this->soldierID = NOBODY;
|
||||
this->object.initialize();
|
||||
}
|
||||
|
||||
@@ -270,7 +270,7 @@ WORLDITEM& WORLDITEM::operator=(OLD_WORLDITEM_101& src)
|
||||
this->bRenderZHeightAboveLevel = src.bRenderZHeightAboveLevel;
|
||||
this->bVisible = src.bVisible;
|
||||
this->ubNonExistChance = src.ubNonExistChance;
|
||||
this->soldierID = -1;
|
||||
this->soldierID = NOBODY;
|
||||
|
||||
//convert the OBJECTTYPE
|
||||
this->object = src.oldObject;
|
||||
@@ -288,7 +288,7 @@ WORLDITEM& WORLDITEM::operator=(_OLD_WORLDITEM& src)//dnl ch42 280909
|
||||
bRenderZHeightAboveLevel = src.bRenderZHeightAboveLevel;
|
||||
bVisible = src.bVisible;
|
||||
ubNonExistChance = src.ubNonExistChance;
|
||||
soldierID = -1;
|
||||
soldierID = NOBODY;
|
||||
object = src.object;
|
||||
}
|
||||
return(*this);
|
||||
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
//Because this value is zero in the saved maps, we can't change it to 100, hence the reversal method.
|
||||
//This check is only performed the first time a map is loaded. Later, it is entirely skipped.
|
||||
UINT8 ubNonExistChance;
|
||||
INT16 soldierID;
|
||||
SoldierID soldierID;
|
||||
char endOfPod;
|
||||
OBJECTTYPE object;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user