Localized the input checker into P_Thing_CheckInputNum now called by both ACS and DECORATE..

This commit is contained in:
MajorCooke 2016-06-20 09:41:46 -05:00
parent 26408a5043
commit 9df65f73fc
4 changed files with 32 additions and 47 deletions

View file

@ -4216,28 +4216,7 @@ int DLevelScript::GetPlayerInput(int playernum, int inputnum)
return 0;
}
switch (inputnum)
{
case INPUT_OLDBUTTONS: return p->original_oldbuttons; break;
case INPUT_BUTTONS: return p->original_cmd.buttons; break;
case INPUT_PITCH: return p->original_cmd.pitch; break;
case INPUT_YAW: return p->original_cmd.yaw; break;
case INPUT_ROLL: return p->original_cmd.roll; break;
case INPUT_FORWARDMOVE: return p->original_cmd.forwardmove; break;
case INPUT_SIDEMOVE: return p->original_cmd.sidemove; break;
case INPUT_UPMOVE: return p->original_cmd.upmove; break;
case MODINPUT_OLDBUTTONS: return p->oldbuttons; break;
case MODINPUT_BUTTONS: return p->cmd.ucmd.buttons; break;
case MODINPUT_PITCH: return p->cmd.ucmd.pitch; break;
case MODINPUT_YAW: return p->cmd.ucmd.yaw; break;
case MODINPUT_ROLL: return p->cmd.ucmd.roll; break;
case MODINPUT_FORWARDMOVE: return p->cmd.ucmd.forwardmove; break;
case MODINPUT_SIDEMOVE: return p->cmd.ucmd.sidemove; break;
case MODINPUT_UPMOVE: return p->cmd.ucmd.upmove; break;
default: return 0; break;
}
return P_Thing_CheckInputNum(p, inputnum);
}
enum

View file

@ -159,6 +159,7 @@ bool P_Thing_Raise(AActor *thing, AActor *raiser);
bool P_Thing_CanRaise(AActor *thing);
PClassActor *P_GetSpawnableType(int spawnnum);
void InitSpawnablesFromMapinfo();
int P_Thing_CheckInputNum(player_t *p, int inputnum);
int P_Thing_Warp(AActor *caller, AActor *reference, double xofs, double yofs, double zofs, DAngle angle, int flags, double heightoffset, double radiusoffset, DAngle pitch);
bool P_Thing_CheckProximity(AActor *self, PClass *classname, double distance, int count, int flags, int ptr);

View file

@ -666,7 +666,36 @@ void InitSpawnablesFromMapinfo()
InitClassMap(SpawnableThings, SpawnablesFromMapinfo);
InitClassMap(StrifeTypes, ConversationIDsFromMapinfo);
}
int P_Thing_CheckInputNum(player_t *p, int inputnum)
{
int renum = 0;
if (p)
{
switch (inputnum)
{
case INPUT_OLDBUTTONS: renum = p->original_oldbuttons; break;
case INPUT_BUTTONS: renum = p->original_cmd.buttons; break;
case INPUT_PITCH: renum = p->original_cmd.pitch; break;
case INPUT_YAW: renum = p->original_cmd.yaw; break;
case INPUT_ROLL: renum = p->original_cmd.roll; break;
case INPUT_FORWARDMOVE: renum = p->original_cmd.forwardmove; break;
case INPUT_SIDEMOVE: renum = p->original_cmd.sidemove; break;
case INPUT_UPMOVE: renum = p->original_cmd.upmove; break;
case MODINPUT_OLDBUTTONS: renum = p->oldbuttons; break;
case MODINPUT_BUTTONS: renum = p->cmd.ucmd.buttons; break;
case MODINPUT_PITCH: renum = p->cmd.ucmd.pitch; break;
case MODINPUT_YAW: renum = p->cmd.ucmd.yaw; break;
case MODINPUT_ROLL: renum = p->cmd.ucmd.roll; break;
case MODINPUT_FORWARDMOVE: renum = p->cmd.ucmd.forwardmove; break;
case MODINPUT_SIDEMOVE: renum = p->cmd.ucmd.sidemove; break;
case MODINPUT_UPMOVE: renum = p->cmd.ucmd.upmove; break;
default: renum = 0; break;
}
}
return renum;
}
bool P_Thing_CheckProximity(AActor *self, PClass *classname, double distance, int count, int flags, int ptr)
{
AActor *ref = COPY_AAPTR(self, ptr);

View file

@ -569,31 +569,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, GetPlayerInput)
}
else
{
player_t *p = mobj->player;
int renum = 0;
switch (inputnum)
{
case INPUT_OLDBUTTONS: renum = p->original_oldbuttons; break;
case INPUT_BUTTONS: renum = p->original_cmd.buttons; break;
case INPUT_PITCH: renum = p->original_cmd.pitch; break;
case INPUT_YAW: renum = p->original_cmd.yaw; break;
case INPUT_ROLL: renum = p->original_cmd.roll; break;
case INPUT_FORWARDMOVE: renum = p->original_cmd.forwardmove; break;
case INPUT_SIDEMOVE: renum = p->original_cmd.sidemove; break;
case INPUT_UPMOVE: renum = p->original_cmd.upmove; break;
case MODINPUT_OLDBUTTONS: renum = p->oldbuttons; break;
case MODINPUT_BUTTONS: renum = p->cmd.ucmd.buttons; break;
case MODINPUT_PITCH: renum = p->cmd.ucmd.pitch; break;
case MODINPUT_YAW: renum = p->cmd.ucmd.yaw; break;
case MODINPUT_ROLL: renum = p->cmd.ucmd.roll; break;
case MODINPUT_FORWARDMOVE: renum = p->cmd.ucmd.forwardmove; break;
case MODINPUT_SIDEMOVE: renum = p->cmd.ucmd.sidemove; break;
case MODINPUT_UPMOVE: renum = p->cmd.ucmd.upmove; break;
default: renum = 0; break;
}
ret->SetInt(renum);
ret->SetInt(P_Thing_CheckInputNum(mobj->player, inputnum));
}
return 1;
}