- Fixed: Backpacks didn't increase the ammo capacity to BackpackMaxAmount if
an ammo type's BackpackAmount was 0. - Fixed some minor bugs in custom skill code. SVN r562 (trunk)
This commit is contained in:
parent
c873ae1709
commit
8f5dd5d028
8 changed files with 15 additions and 10 deletions
|
|
@ -1497,8 +1497,7 @@ AInventory *ABackpackItem::CreateCopy (AActor *other)
|
|||
{
|
||||
const PClass *type = PClass::m_Types[i];
|
||||
|
||||
if (type->ParentClass == RUNTIME_CLASS(AAmmo) &&
|
||||
((AAmmo *)GetDefaultByType (type))->BackpackAmount > 0)
|
||||
if (type->ParentClass == RUNTIME_CLASS(AAmmo))
|
||||
{
|
||||
AAmmo *ammo = static_cast<AAmmo *>(other->FindInventory (type));
|
||||
int amount = static_cast<AAmmo *>(GetDefaultByType(type))->BackpackAmount;
|
||||
|
|
@ -1507,6 +1506,7 @@ AInventory *ABackpackItem::CreateCopy (AActor *other)
|
|||
{
|
||||
amount = FixedMul(amount, G_SkillProperty(SKILLP_AmmoFactor));
|
||||
}
|
||||
if (amount < 0) amount = 0;
|
||||
if (ammo == NULL)
|
||||
{ // The player did not have the ammo. Add it.
|
||||
ammo = static_cast<AAmmo *>(Spawn (type, 0, 0, 0, NO_REPLACE));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue