- SW: Abort GetInput immediately if no valid sprite is attached to the given player.

This commit is contained in:
Christoph Oelckers 2021-05-11 00:52:08 +02:00
parent 5d5af0cb09
commit ae94fb921c

View file

@ -162,7 +162,9 @@ static void processWeapon(PLAYERp const pp)
void GameInterface::GetInput(InputPacket *packet, ControlInfo* const hidInput)
{
if (paused || M_Active())
PLAYERp pp = &Player[myconnectindex];
if (paused || M_Active() || pp->PlayerSprite <= -1)
{
loc = {};
return;
@ -170,7 +172,6 @@ void GameInterface::GetInput(InputPacket *packet, ControlInfo* const hidInput)
double const scaleAdjust = InputScale();
InputPacket input {};
PLAYERp pp = &Player[myconnectindex];
ApplyGlobalInput(loc, hidInput);
processMovement(&input, &loc, hidInput, scaleAdjust, 0, !pp->sop, pp->sop_control ? 3. / 1.40625 : 1.);