mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2025-02-22 11:11:25 +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
|
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
|
- 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.)
|
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)
|
AInventory *ABackpackItem::CreateCopy (AActor *other)
|
||||||
{
|
{
|
||||||
// Find every unique type of ammo. Give it to the player if
|
// 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)
|
for (unsigned int i = 0; i < PClass::m_Types.Size(); ++i)
|
||||||
{
|
{
|
||||||
const PClass *type = PClass::m_Types[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.
|
{ // The player did not have the ammo. Add it.
|
||||||
ammo = static_cast<AAmmo *>(Spawn (type, 0, 0, 0, NO_REPLACE));
|
ammo = static_cast<AAmmo *>(Spawn (type, 0, 0, 0, NO_REPLACE));
|
||||||
ammo->Amount = bDepleted ? 0 : amount;
|
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);
|
ammo->AttachToOwner (other);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue