- initialize the PlayerPawn members only used by scripts through the script variable interface.

The goal here is to eliminate the native PlayerPawn class, after all, so this will be needed anyway.
This commit is contained in:
Christoph Oelckers 2019-01-03 08:27:41 +01:00
parent 850ef1cd78
commit da735c0e87
3 changed files with 11 additions and 6 deletions

View file

@ -146,13 +146,13 @@ public:
FName Face; // Doom status bar face (when used) FName Face; // Doom status bar face (when used)
FName Portrait; FName Portrait;
FName Slot[10]; FName Slot[10];
double HexenArmor[5];
// Everything below this point is only used by scripted code. // Everything below this point is only used by scripted code.
int RunHealth; int RunHealth;
TObjPtr<AActor*> InvFirst; // first inventory item displayed on inventory bar TObjPtr<AActor*> InvFirst; // first inventory item displayed on inventory bar
double ForwardMove1, ForwardMove2; double ForwardMove1, ForwardMove2;
double SideMove1, SideMove2; double SideMove1, SideMove2;
double HexenArmor[5];
PClassActor *FlechetteType; PClassActor *FlechetteType;
}; };

View file

@ -1032,6 +1032,10 @@ xx(PickupSound)
xx(ColorRangeStart) xx(ColorRangeStart)
xx(ColorRangeEnd) xx(ColorRangeEnd)
xx(InvFirst) xx(InvFirst)
xx(ForwardMove1)
xx(ForwardMove2)
xx(SideMove1)
xx(SideMove2)
xx(BlueCard) xx(BlueCard)
xx(YellowCard) xx(YellowCard)

View file

@ -1541,11 +1541,11 @@ DEFINE_CLASS_PROPERTY_PREFIX(player, spawnclass, L, PlayerPawn)
DEFINE_CLASS_PROPERTY_PREFIX(player, forwardmove, F_f, PlayerPawn) DEFINE_CLASS_PROPERTY_PREFIX(player, forwardmove, F_f, PlayerPawn)
{ {
PROP_DOUBLE_PARM(m, 0); PROP_DOUBLE_PARM(m, 0);
defaults->ForwardMove1 = defaults->ForwardMove2 = m; defaults->FloatVar(NAME_ForwardMove1) = defaults->FloatVar(NAME_ForwardMove2) = m;
if (PROP_PARM_COUNT > 1) if (PROP_PARM_COUNT > 1)
{ {
PROP_DOUBLE_PARM(m2, 1); PROP_DOUBLE_PARM(m2, 1);
defaults->ForwardMove2 = m2; defaults->FloatVar(NAME_ForwardMove2) = m2;
} }
} }
@ -1555,11 +1555,11 @@ DEFINE_CLASS_PROPERTY_PREFIX(player, forwardmove, F_f, PlayerPawn)
DEFINE_CLASS_PROPERTY_PREFIX(player, sidemove, F_f, PlayerPawn) DEFINE_CLASS_PROPERTY_PREFIX(player, sidemove, F_f, PlayerPawn)
{ {
PROP_DOUBLE_PARM(m, 0); PROP_DOUBLE_PARM(m, 0);
defaults->SideMove1 = defaults->SideMove2 = m; defaults->FloatVar(NAME_SideMove1) = defaults->FloatVar(NAME_SideMove2) = m;
if (PROP_PARM_COUNT > 1) if (PROP_PARM_COUNT > 1)
{ {
PROP_DOUBLE_PARM(m2, 1); PROP_DOUBLE_PARM(m2, 1);
defaults->SideMove2 = m2; defaults->FloatVar(NAME_SideMove2) = m2;
} }
} }
@ -1666,7 +1666,8 @@ DEFINE_CLASS_PROPERTY_PREFIX(player, hexenarmor, FFFFF, PlayerPawn)
for (int i = 0; i < 5; i++) for (int i = 0; i < 5; i++)
{ {
PROP_DOUBLE_PARM(val, i); PROP_DOUBLE_PARM(val, i);
defaults->HexenArmor[i] = val; auto hexarmor = &defaults->FloatVar(NAME_HexenArmor);
hexarmor[i] = val;
} }
} }