- removed all direct access to AWeapon's members to prepare moving this class fully to the script side.

Disregarding UI-side and setup-related calls there's unfortunately still 6 places in the native game code which require direct access.
This commit is contained in:
Christoph Oelckers 2018-11-25 08:17:37 +01:00
commit b5c4ab8c47
18 changed files with 95 additions and 76 deletions

View file

@ -799,7 +799,7 @@ static int LookAdjust(int look)
if (players[consoleplayer].playerstate != PST_DEAD && // No adjustment while dead.
players[consoleplayer].ReadyWeapon != NULL) // No adjustment if no weapon.
{
auto scale = players[consoleplayer].ReadyWeapon->FOVScale;
auto scale = players[consoleplayer].ReadyWeapon->FloatVar(NAME_FOVScale);
if (scale > 0) // No adjustment if it is non-positive.
{
look = int(look * scale);
@ -1301,8 +1301,8 @@ void G_PlayerFinishLevel (int player, EFinishLevelType mode, int flags)
item = next;
}
if (p->ReadyWeapon != NULL &&
p->ReadyWeapon->WeaponFlags&WIF_POWERED_UP &&
p->PendingWeapon == p->ReadyWeapon->SisterWeapon)
p->ReadyWeapon->IntVar(NAME_WeaponFlags) & WIF_POWERED_UP &&
p->PendingWeapon == p->ReadyWeapon->PointerVar<AInventory>(NAME_SisterWeapon))
{
// Unselect powered up weapons if the unpowered counterpart is pending
p->ReadyWeapon=p->PendingWeapon;