Merged revision(s) 7507 from branches/ja2_source_official_2014:

Fix: under certain circumstances, picking up LBE that could be worn, while slots this LBE would use were already in use, corrupted objects.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7508 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2014-09-11 20:14:43 +00:00
parent 68dbf0da05
commit e3a94de7a3
+5 -3
View File
@@ -2398,7 +2398,6 @@ void SoldierGetItemFromWorld( SOLDIERTYPE *pSoldier, INT32 iItemIndex, INT32 sGr
} }
} }
*/ */
RemoveItemFromPool( sGridNo, iItemIndex, pSoldier->pathing.bLevel );
// Flugente: if we allow militia to use sector equipment, then mark gear they pick up, so that they drop it too. // Flugente: if we allow militia to use sector equipment, then mark gear they pick up, so that they drop it too.
if ( pSoldier->bTeam == MILITIA_TEAM && gGameExternalOptions.fMilitiaUseSectorInventory ) if ( pSoldier->bTeam == MILITIA_TEAM && gGameExternalOptions.fMilitiaUseSectorInventory )
@@ -2433,7 +2432,7 @@ void SoldierGetItemFromWorld( SOLDIERTYPE *pSoldier, INT32 iItemIndex, INT32 sGr
if ( gWorldItems[ iItemIndex ].usFlags & WORLD_ITEM_TABOO_FOR_MILITIA_EQ_BLUE ) if ( gWorldItems[ iItemIndex ].usFlags & WORLD_ITEM_TABOO_FOR_MILITIA_EQ_BLUE )
gWorldItems[ iItemIndex ].object[0]->data.sObjectFlag |= TAKEN_BY_MILITIA_TABOO_BLUE; gWorldItems[ iItemIndex ].object[0]->data.sObjectFlag |= TAKEN_BY_MILITIA_TABOO_BLUE;
} }
if ( !AutoPlaceObject( pSoldier, &(gWorldItems[ iItemIndex ].object ), TRUE ) ) if ( !AutoPlaceObject( pSoldier, &(gWorldItems[ iItemIndex ].object ), TRUE ) )
{ {
//ADB well we made an animation, should we still use up points? //ADB well we made an animation, should we still use up points?
@@ -2444,8 +2443,11 @@ void SoldierGetItemFromWorld( SOLDIERTYPE *pSoldier, INT32 iItemIndex, INT32 sGr
{ {
fItemTaken = TRUE; fItemTaken = TRUE;
} }
}
// Flugente: if we remove an object, we basically give it free to overwriting. Thus it is very, VERY bad to theninteract with it, as the code might jsut do that -
// the object data may be overwritten at any moment! Better remove it after manipulation is finished.
RemoveItemFromPool( sGridNo, iItemIndex, pSoldier->pathing.bLevel );
}
} }
} }
} }