ValveSoftware / halflife

Half-Life 1 engine based games
Other
3.7k stars 624 forks source link

Snarks have their movetype changed to MOVETYPE_BOUNCE unconditionally when not in water #3175

Open SamVanheer opened 2 years ago

SamVanheer commented 2 years ago

The snark has an incorrect if statement here: https://github.com/ValveSoftware/halflife/blob/c7240b965743a53a29491dd49320c88eecf6257b/dlls/squeakgrenade.cpp#L223-L236

This conditional check changes the value of the movetype to MOVETYPE_FLY and then immediately after that to MOVETYPE_BOUNCE.

The intended behavior of this code is to restore the Snark's movetype to bounce when it leaves water, but only if its previous movetype was fly.

Although the Snark's behavior is still correct barring changes to the movetype from outside the Snark's code, this check should be fixed so modders can safely change the movetype without having to deal with this overriding behavior.

The fix:

else if (pev->movetype == MOVETYPE_FLY)
{
    pev->movetype = MOVETYPE_BOUNCE;
}
SamVanheer commented 2 years ago

This also applies to Opposing Force's Penguin grenade, since its code is a copy of the Snark.