mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-22 04:21:23 +00:00
Fix automatic mode z-target bugs and crashes
This commit is contained in:
parent
b6544efceb
commit
92cccd682c
1 changed files with 12 additions and 9 deletions
|
@ -1420,7 +1420,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
|
||||
ticcmd_centerviewdown[forplayer] = true;
|
||||
}
|
||||
else if (ticcmd_centerviewdown[forplayer])
|
||||
else if (ticcmd_centerviewdown[forplayer] || (leveltime < 5))
|
||||
{
|
||||
if (controlstyle == CS_SIMPLE)
|
||||
{
|
||||
|
@ -1435,6 +1435,9 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
{
|
||||
if (
|
||||
P_MobjWasRemoved(ticcmd_ztargetfocus[forplayer]) ||
|
||||
(leveltime < 5) ||
|
||||
(player->playerstate != PST_LIVE) ||
|
||||
player->exiting ||
|
||||
!ticcmd_ztargetfocus[forplayer]->health ||
|
||||
(ticcmd_ztargetfocus[forplayer]->type == MT_EGGMOBILE3 && !ticcmd_ztargetfocus[forplayer]->movecount) // Sea Egg is moving around underground and shouldn't be tracked
|
||||
)
|
||||
|
@ -1466,7 +1469,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
P_SetTarget(&newtarget->target, ticcmd_ztargetfocus[forplayer]);
|
||||
newtarget->drawonlyforplayer = player; // Hide it from the other player in splitscreen, and yourself when spectating
|
||||
|
||||
if (player->mo && P_AproxDistance(
|
||||
if (player->mo && R_PointToDist2(0, 0,
|
||||
player->mo->x - ticcmd_ztargetfocus[forplayer]->x,
|
||||
player->mo->y - ticcmd_ztargetfocus[forplayer]->y
|
||||
) > 50*player->mo->scale)
|
||||
|
|
Loading…
Reference in a new issue