- deleted unused pointers and handled u() in the script interface.

This commit is contained in:
Christoph Oelckers 2021-12-26 01:18:02 +01:00
parent 6df854d612
commit 050d93a92c
3 changed files with 3 additions and 15 deletions

View file

@ -7220,22 +7220,19 @@ DEFINE_FIELD_X(SWPlayer, PLAYERstruct, WpnReloadState)
DEFINE_ACTION_FUNCTION(_SWPlayer, WeaponNum)
{
PARAM_SELF_STRUCT_PROLOGUE(PLAYERstruct);
USERp uu = self->Actor()->u();
ACTION_RETURN_INT(uu->WeaponNum);
ACTION_RETURN_INT(self->actor->user.WeaponNum);
}
DEFINE_ACTION_FUNCTION(_SWPlayer, Health)
{
PARAM_SELF_STRUCT_PROLOGUE(PLAYERstruct);
USERp uu = self->Actor()->u();
ACTION_RETURN_INT(uu->Health);
ACTION_RETURN_INT(self->actor->user.Health);
}
DEFINE_ACTION_FUNCTION(_SWPlayer, MaxUserHealth)
{
PARAM_SELF_STRUCT_PROLOGUE(PLAYERstruct);
USERp uu = self->Actor()->u();
ACTION_RETURN_INT(uu->MaxHealth);
ACTION_RETURN_INT(self->actor->user.MaxHealth);
}
DEFINE_ACTION_FUNCTION(_SWPlayer, GetBuildAngle)

View file

@ -70,7 +70,6 @@ void InitPrediction(PLAYERp pp)
void DoPrediction(PLAYERp ppp)
{
#if 0
USERp u;
spritetype spr;
int bakrandomseed;

View file

@ -10440,8 +10440,6 @@ void SpawnExpZadjust(DSWActor* actor, DSWActor* expActor, int upper_zsize, int l
void SpawnMineExp(DSWActor* actor)
{
USERp eu;
ASSERT(actor->hasU());
if (actor->hasU() && TEST(actor->user.Flags, SPR_SUICIDE))
return;
@ -10489,7 +10487,6 @@ int DoSectorExp(DSWActor* actor)
DSWActor* SpawnSectorExp(DSWActor* actor)
{
USERp eu;
short explosion;
ASSERT(actor->hasU());
@ -10519,8 +10516,6 @@ DSWActor* SpawnSectorExp(DSWActor* actor)
// called from SpawnShrap
DSWActor* SpawnLargeExp(DSWActor* actor)
{
USERp eu;
PlaySound(DIGI_30MMEXPLODE, actor, v3df_none);
auto expActor = SpawnActor(STAT_MISSILE, GRENADE_EXP, s_SectorExp, actor->spr.sector(),
@ -10586,7 +10581,6 @@ void SpawnMeteorExp(DSWActor* actor)
void SpawnLittleExp(DSWActor* actor)
{
USERp eu;
short explosion;
PlaySound(DIGI_HEADSHOTHIT, actor, v3df_none);
@ -10819,8 +10813,6 @@ int DoNapalm(DSWActor* actor)
if (!actor->user.Counter)
{
USERp eu;
PlaySound(DIGI_NAPPUFF, actor, v3df_none);
auto expActor = SpawnActor(STAT_MISSILE, NAP_EXP, s_NapExp, actor->spr.sector(),