mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-22 11:22:18 -04:00
do not apply weapon centering in strict mode (#1121)
* do not apply weapon centering in strict mode * checkfor psp->state only once
This commit is contained in:
parent
17ab98a864
commit
5b832c021b
64
src/p_pspr.c
64
src/p_pspr.c
@ -1080,6 +1080,7 @@ void P_SetupPsprites(player_t *player)
|
||||
void P_MovePsprites(player_t *player)
|
||||
{
|
||||
pspdef_t *psp = player->psprites;
|
||||
const int center_weapon_strict = STRICTMODE(center_weapon);
|
||||
int i;
|
||||
|
||||
// a null state means not active
|
||||
@ -1098,39 +1099,42 @@ void P_MovePsprites(player_t *player)
|
||||
psp->sx2 = psp->sx;
|
||||
psp->sy2 = psp->sy;
|
||||
|
||||
if (psp->state && !cosmetic_bobbing)
|
||||
if (psp->state)
|
||||
{
|
||||
static fixed_t last_sy = WEAPONTOP;
|
||||
if (!cosmetic_bobbing)
|
||||
{
|
||||
static fixed_t last_sy = WEAPONTOP;
|
||||
|
||||
psp->sx2 = FRACUNIT;
|
||||
|
||||
if (!psp->state->misc1 && !player->switching)
|
||||
{
|
||||
last_sy = psp->sy2;
|
||||
psp->sy2 = WEAPONTOP;
|
||||
}
|
||||
else if (player->switching == weapswitch_lowering)
|
||||
{
|
||||
// We want to move smoothly from where we were
|
||||
psp->sy2 -= (last_sy - WEAPONTOP);
|
||||
}
|
||||
}
|
||||
else if (psp->state && (cosmetic_bobbing == BOBBING_75 || center_weapon || uncapped))
|
||||
{
|
||||
// [FG] don't center during lowering and raising states
|
||||
if (psp->state->misc1 || player->switching)
|
||||
{
|
||||
}
|
||||
// [FG] not attacking means idle
|
||||
else if (!player->attackdown || center_weapon == WEAPON_BOBBING)
|
||||
{
|
||||
P_ApplyBobbing(&psp->sx2, &psp->sy2, player->bob2);
|
||||
}
|
||||
// [FG] center the weapon sprite horizontally and push up vertically
|
||||
else if (center_weapon == WEAPON_CENTERED)
|
||||
{
|
||||
psp->sx2 = FRACUNIT;
|
||||
psp->sy2 = WEAPONTOP;
|
||||
|
||||
if (!psp->state->misc1 && !player->switching)
|
||||
{
|
||||
last_sy = psp->sy2;
|
||||
psp->sy2 = WEAPONTOP;
|
||||
}
|
||||
else if (player->switching == weapswitch_lowering)
|
||||
{
|
||||
// We want to move smoothly from where we were
|
||||
psp->sy2 -= (last_sy - WEAPONTOP);
|
||||
}
|
||||
}
|
||||
else if (cosmetic_bobbing == BOBBING_75 || center_weapon_strict || uncapped)
|
||||
{
|
||||
// [FG] don't center during lowering and raising states
|
||||
if (psp->state->misc1 || player->switching)
|
||||
{
|
||||
}
|
||||
// [FG] not attacking means idle
|
||||
else if (!player->attackdown || center_weapon_strict == WEAPON_BOBBING)
|
||||
{
|
||||
P_ApplyBobbing(&psp->sx2, &psp->sy2, player->bob2);
|
||||
}
|
||||
// [FG] center the weapon sprite horizontally and push up vertically
|
||||
else if (center_weapon_strict == WEAPON_CENTERED)
|
||||
{
|
||||
psp->sx2 = FRACUNIT;
|
||||
psp->sy2 = WEAPONTOP;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user