Merge remote-tracking branch 'remotes/origin/weapon_scriptification' into asmjit

# Conflicts:
#	src/g_inventory/a_pickups.cpp
This commit is contained in:
Christoph Oelckers 2018-11-30 21:28:44 +01:00
commit a0c0e8bdfe
96 changed files with 4828 additions and 4759 deletions

View file

@ -1039,22 +1039,22 @@ public:
}
wrapper->ForceHUDScale(script->huds[hud]->ForceScaled());
if (CPlayer->ReadyWeapon != NULL)
if (CPlayer->ReadyWeapon != nullptr)
{
ammo1 = CPlayer->ReadyWeapon->Ammo1;
ammo2 = CPlayer->ReadyWeapon->Ammo2;
if (ammo1 == NULL)
ammo1 = CPlayer->ReadyWeapon->PointerVar<AInventory>(NAME_Ammo1);
ammo2 = CPlayer->ReadyWeapon->PointerVar<AInventory>(NAME_Ammo2);
if (ammo1 == nullptr)
{
ammo1 = ammo2;
ammo2 = NULL;
ammo2 = nullptr;
}
}
else
{
ammo1 = ammo2 = NULL;
ammo1 = ammo2 = nullptr;
}
ammocount1 = ammo1 != NULL ? ammo1->Amount : 0;
ammocount2 = ammo2 != NULL ? ammo2->Amount : 0;
ammocount1 = ammo1 != nullptr ? ammo1->Amount : 0;
ammocount2 = ammo2 != nullptr ? ammo2->Amount : 0;
//prepare ammo counts
armor = CPlayer->mo->FindInventory(NAME_BasicArmor);
@ -1467,6 +1467,12 @@ public:
return TRANSLATION(TRANSLATION_Players, int(CPlayer - players));
}
PClassActor *AmmoType(int no) const
{
auto w = StatusBar->CPlayer->ReadyWeapon;
return w == nullptr ? nullptr : (w->PointerVar<PClassActor>(no == 1 ? NAME_AmmoType1 : NAME_AmmoType2));
}
AInventory *ammo1, *ammo2;
int ammocount1, ammocount2;
AInventory *armor;