mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 14:51:51 +00:00
- Fixed: When giving completely new ammo, the backpack did not clamp the
amount given to the ammo's max amount. SVN r1931 (trunk)
This commit is contained in:
parent
1c9b693087
commit
1a6d7b6eca
2 changed files with 11 additions and 2 deletions
|
@ -1,4 +1,6 @@
|
|||
October 23, 2009
|
||||
- Fixed: When giving completely new ammo, the backpack did not clamp the
|
||||
amount given to the ammo's max amount.
|
||||
- Fixed drawing of wide high resolution skies. (At least for the samples I
|
||||
received. I'm not convinced that it's yet fixed for the general case.)
|
||||
|
||||
|
|
|
@ -1569,7 +1569,7 @@ void ABackpackItem::Serialize (FArchive &arc)
|
|||
AInventory *ABackpackItem::CreateCopy (AActor *other)
|
||||
{
|
||||
// Find every unique type of ammo. Give it to the player if
|
||||
// he doesn't have it already, and double it's maximum capacity.
|
||||
// he doesn't have it already, and double its maximum capacity.
|
||||
for (unsigned int i = 0; i < PClass::m_Types.Size(); ++i)
|
||||
{
|
||||
const PClass *type = PClass::m_Types[i];
|
||||
|
@ -1588,7 +1588,14 @@ AInventory *ABackpackItem::CreateCopy (AActor *other)
|
|||
{ // The player did not have the ammo. Add it.
|
||||
ammo = static_cast<AAmmo *>(Spawn (type, 0, 0, 0, NO_REPLACE));
|
||||
ammo->Amount = bDepleted ? 0 : amount;
|
||||
if (ammo->BackpackMaxAmount > ammo->MaxAmount) ammo->MaxAmount = ammo->BackpackMaxAmount;
|
||||
if (ammo->BackpackMaxAmount > ammo->MaxAmount)
|
||||
{
|
||||
ammo->MaxAmount = ammo->BackpackMaxAmount;
|
||||
}
|
||||
if (ammo->Amount > ammo->MaxAmount)
|
||||
{
|
||||
ammo->Amount = ammo->MaxAmount;
|
||||
}
|
||||
ammo->AttachToOwner (other);
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue