- scriptified the remains of AAmmo.

This commit is contained in:
Christoph Oelckers 2017-01-18 14:18:17 +01:00
commit d9fd2d509f
22 changed files with 122 additions and 245 deletions

View file

@ -21,7 +21,6 @@
#include "d_event.h"
#include "d_player.h"
#include "vectors.h"
#include "a_ammo.h"
static FRandom pr_botmove ("BotMove");
@ -346,12 +345,12 @@ void DBot::WhatToGet (AActor *item)
}
}
}
else if (item->IsKindOf (RUNTIME_CLASS(AAmmo)))
else if (item->IsKindOf (PClass::FindActor(NAME_Ammo)))
{
AAmmo *ammo = static_cast<AAmmo *> (item);
PClassActor *parent = ammo->GetParentAmmo ();
AInventory *holdingammo = player->mo->FindInventory (parent);
auto ac = PClass::FindActor(NAME_Ammo);
auto parent = item->GetClass();
while (parent->ParentClass != ac) parent = (PClassActor*)(parent->ParentClass);
AInventory *holdingammo = player->mo->FindInventory(parent);
if (holdingammo != NULL && holdingammo->Amount >= holdingammo->MaxAmount)
{
return;