mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Fix for Bug#99
Fix for Bug#100 git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2170 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -1708,7 +1708,11 @@ void MakeObjectOutOfDealerItems( DEALER_SPECIAL_ITEM *pSpclItemInfo, OBJECTTYPE
|
||||
// have to keep track of #bullets in a gun throughout dealer inventory. Without this, players could "reload" guns
|
||||
// they don't have ammo for by selling them to Tony & buying them right back fully loaded! One could repeat this
|
||||
// ad nauseum (empty the gun between visits) as a (really expensive) way to get unlimited special ammo like rockets.
|
||||
(*pObject)[subObject]->data.gun.ubGunShotsLeft = 0;
|
||||
//CHRISL: If we're working with a SingleShotRocketLauncher, we need ubGunShotsLeft to equal 1
|
||||
if(Item[pObject->usItem].singleshotrocketlauncher == TRUE)
|
||||
(*pObject)[subObject]->data.gun.ubGunShotsLeft = 1;
|
||||
else
|
||||
(*pObject)[subObject]->data.gun.ubGunShotsLeft = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6589,7 +6589,11 @@ void SplitComplexObjectIntoSubObjects( OBJECTTYPE *pComplexObject )
|
||||
|
||||
subObjects.clear();
|
||||
int usItem = pComplexObject->usItem;
|
||||
for (int x = 0; x < pComplexObject->ubNumberOfObjects; ++x) {
|
||||
//CHRISL: This won't work. As we his MoveThisObjectTo, we reduce ubNumberOfObjects. If we started with ubNumberOfObjects=4 & x=0,
|
||||
// our first iteration would be ubNumberOfObjects=3 & x=1. Then ubNumberOfObjects=2 & x=2, which ends the loop. We want to
|
||||
// run the loop ubNumberOfObjects number of times regardless of whether ubNumberOfObjects is reduced. Use a while loop.
|
||||
//for (int x = 0; x < pComplexObject->ubNumberOfObjects; ++x) {
|
||||
while(pComplexObject->ubNumberOfObjects > 0) {
|
||||
//we need not worry about attachments!!!!
|
||||
|
||||
if (pComplexObject->MoveThisObjectTo(gTempObject, 1) == 0) {
|
||||
|
||||
Reference in New Issue
Block a user