- removed all direct access to AInventory's members.

We are getting closer to make class Inventory fully scripted.
This commit is contained in:
Christoph Oelckers 2018-12-04 00:22:26 +01:00
commit a573c63f60
11 changed files with 64 additions and 56 deletions

View file

@ -371,8 +371,8 @@ void DBot::WhatToGet (AActor *item)
return;
auto ammo1 = heldWeapon->PointerVar<AInventory>(NAME_Ammo1);
auto ammo2 = heldWeapon->PointerVar<AInventory>(NAME_Ammo2);
if ((ammo1 == NULL || ammo1->IntVar(NAME_Amount) >= ammo1->MaxAmount) &&
(ammo2 == NULL || ammo2->IntVar(NAME_Amount) >= ammo2->MaxAmount))
if ((ammo1 == NULL || ammo1->IntVar(NAME_Amount) >= ammo1->IntVar(NAME_MaxAmount)) &&
(ammo2 == NULL || ammo2->IntVar(NAME_Amount) >= ammo2->IntVar(NAME_MaxAmount)))
{
return;
}
@ -384,7 +384,7 @@ void DBot::WhatToGet (AActor *item)
auto parent = item->GetClass();
while (parent->ParentClass != ac) parent = static_cast<PClassActor*>(parent->ParentClass);
AInventory *holdingammo = player->mo->FindInventory(parent);
if (holdingammo != NULL && holdingammo->IntVar(NAME_Amount) >= holdingammo->MaxAmount)
if (holdingammo != NULL && holdingammo->IntVar(NAME_Amount) >= holdingammo->IntVar(NAME_MaxAmount))
{
return;
}