mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
- fixed a bug that caused bad pointers when accessing the sector inventory and then entering it
- fixed: reinforcements can happen in turnbased again - codechange: stacks of ammo item scan now be used to feed a gun from the inventory git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5458 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -2247,6 +2247,15 @@ void SOLDIERTYPE::CalcNewActionPoints( void )
|
||||
}
|
||||
|
||||
this->bInitialActionPoints = this->bActionPoints;
|
||||
|
||||
// Flugente: due to changes and bugs with enemy reinforcements, we now set a flag if a soldier should start with no APs, and act here accordingly
|
||||
if ( this->bSoldierFlagMask & SOLDIER_NO_AP )
|
||||
{
|
||||
this->bSoldierFlagMask &= ~SOLDIER_NO_AP;
|
||||
|
||||
this->bInitialActionPoints = 0;
|
||||
this->bActionPoints = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13916,21 +13925,20 @@ BOOLEAN SOLDIERTYPE::IsFeedingExternal(UINT8* pubId1, UINT16* pGunSlot1, UINT16
|
||||
|
||||
if ( pAmmoObj != NULL ) // ... if pointer is not obviously useless ...
|
||||
{
|
||||
if ( pAmmoObj->ubNumberOfObjects == 1 )
|
||||
//if ( pAmmoObj->ubNumberOfObjects == 1 )
|
||||
{
|
||||
usAmmoItem = pAmmoObj->usItem;
|
||||
|
||||
if ( Item [ usAmmoItem ].usItemClass == IC_AMMO && HasItemFlag( usAmmoItem, AMMO_BELT ) )
|
||||
{
|
||||
// remember the caliber, magsize (TODO: really?) and type of ammo. They all have to fit
|
||||
// remember the caliber and type of ammo. They all have to fit
|
||||
usMagIndex = Item[usAmmoItem].ubClassIndex;
|
||||
usAmmoCalibre = Magazine[usMagIndex].ubCalibre;
|
||||
//usAmmoMagSize = Magazine[usMagIndex].ubMagSize;
|
||||
usAmmoAmmoType = Magazine[usMagIndex].ubAmmoType;
|
||||
|
||||
if ( usGunCalibre == usAmmoCalibre && /*usGunMagSize == usAmmoMagSize &&*/ usGunAmmoType == usAmmoAmmoType )
|
||||
if ( usGunCalibre == usAmmoCalibre && usGunAmmoType == usAmmoAmmoType )
|
||||
{
|
||||
// same calibre, same magsize, same ammotype. We can serve this guy
|
||||
// same calibre, same ammotype. We can serve this guy
|
||||
if ( !firstgunfound )
|
||||
{
|
||||
firstgunfound = TRUE;
|
||||
|
||||
Reference in New Issue
Block a user