- 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:
Christoph Oelckers 2007-11-04 08:39:05 +00:00
commit 8f5dd5d028
8 changed files with 15 additions and 10 deletions

View file

@ -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));