- got rid of PClassWeapon.

Still 5 subclasses of PClass left...
This commit is contained in:
Christoph Oelckers 2017-02-07 19:02:27 +01:00
commit 7ed554158c
8 changed files with 118 additions and 155 deletions

View file

@ -2675,8 +2675,8 @@ void FParser::SF_PlayerWeapon()
script_error("weaponnum out of range! %d\n", weaponnum);
return;
}
PClassWeapon * ti = static_cast<PClassWeapon *>(PClass::FindActor(WeaponNames[weaponnum]));
if (!ti)
auto ti = PClass::FindActor(WeaponNames[weaponnum]);
if (!ti || !ti->IsDescendantOf(RUNTIME_CLASS(AWeapon)))
{
script_error("incompatibility in playerweapon %d\n", weaponnum);
return;
@ -2686,7 +2686,7 @@ void FParser::SF_PlayerWeapon()
{
AActor * wp = players[playernum].mo->FindInventory(ti);
t_return.type = svt_int;
t_return.value.i = wp!=NULL;;
t_return.value.i = wp!=NULL;
return;
}
else
@ -2756,8 +2756,8 @@ void FParser::SF_PlayerSelectedWeapon()
script_error("weaponnum out of range! %d\n", weaponnum);
return;
}
PClassWeapon * ti = static_cast<PClassWeapon *>(PClass::FindActor(WeaponNames[weaponnum]));
if (!ti)
auto ti = PClass::FindActor(WeaponNames[weaponnum]);
if (!ti || !ti->IsDescendantOf(RUNTIME_CLASS(AWeapon)))
{
script_error("incompatibility in playerweapon %d\n", weaponnum);
return;