- removed all remaining native components of the weapon class.

This commit is contained in:
Christoph Oelckers 2018-11-25 10:00:55 +01:00
commit d6b781312c
25 changed files with 130 additions and 253 deletions

View file

@ -507,7 +507,7 @@ static int DrawKeys(player_t * CPlayer, int x, int y)
//---------------------------------------------------------------------------
static TArray<PClassActor *> orderedammos;
static void AddAmmoToList(AWeapon * weapdef)
static void AddAmmoToList(AInventory * weapdef)
{
for (int i = 0; i < 2; i++)
@ -570,7 +570,7 @@ static int DrawAmmo(player_t *CPlayer, int x, int y)
char buf[256];
AInventory *inv;
AWeapon *wi=CPlayer->ReadyWeapon;
auto wi=CPlayer->ReadyWeapon;
orderedammos.Clear();
@ -593,7 +593,7 @@ static int DrawAmmo(player_t *CPlayer, int x, int y)
if (hud_showammo > 1 || CPlayer->mo->FindInventory(weap))
{
AddAmmoToList((AWeapon*)GetDefaultByType(weap));
AddAmmoToList((AInventory*)GetDefaultByType(weap));
}
}
}
@ -603,7 +603,7 @@ static int DrawAmmo(player_t *CPlayer, int x, int y)
{
if (inv->IsKindOf(NAME_Weapon))
{
AddAmmoToList((AWeapon*)inv);
AddAmmoToList(inv);
}
}
}
@ -736,7 +736,7 @@ DEFINE_ACTION_FUNCTION(DBaseStatusBar, GetInventoryIcon)
return MIN(numret, 2);
}
static void DrawOneWeapon(player_t * CPlayer, int x, int & y, AWeapon * weapon)
static void DrawOneWeapon(player_t * CPlayer, int x, int & y, AInventory * weapon)
{
double trans;
@ -776,9 +776,9 @@ static void DrawWeapons(player_t *CPlayer, int x, int y)
for(inv = CPlayer->mo->Inventory; inv; inv = inv->Inventory)
{
if (inv->IsKindOf(NAME_Weapon) &&
!CPlayer->weapons.LocateWeapon(static_cast<AWeapon*>(inv)->GetClass(), NULL, NULL))
!CPlayer->weapons.LocateWeapon(inv->GetClass(), NULL, NULL))
{
DrawOneWeapon(CPlayer, x, y, static_cast<AWeapon*>(inv));
DrawOneWeapon(CPlayer, x, y, inv);
}
}
@ -791,7 +791,7 @@ static void DrawWeapons(player_t *CPlayer, int x, int y)
inv=CPlayer->mo->FindInventory(weap);
if (inv)
{
DrawOneWeapon(CPlayer, x, y, static_cast<AWeapon*>(inv));
DrawOneWeapon(CPlayer, x, y, inv);
}
}
}