mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 09:11:48 +00:00
Checkpoint players at star post exact location with Ambush flag
This commit is contained in:
parent
1e2a4c2cce
commit
e60ba92a92
1 changed files with 13 additions and 4 deletions
|
@ -1453,6 +1453,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
|||
|
||||
if (cv_coopstarposts.value && G_GametypeUsesCoopStarposts() && (netgame || multiplayer))
|
||||
{
|
||||
mobj_t *checkbase = (special->spawnpoint && (special->spawnpoint->options & MTF_AMBUSH)) ? special : toucher;
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (playeringame[i])
|
||||
|
@ -1461,8 +1462,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
|||
continue;
|
||||
|
||||
players[i].starposttime = leveltime;
|
||||
players[i].starpostx = player->mo->x>>FRACBITS;
|
||||
players[i].starposty = player->mo->y>>FRACBITS;
|
||||
players[i].starpostx = checkbase->x>>FRACBITS;
|
||||
players[i].starposty = checkbase->y>>FRACBITS;
|
||||
players[i].starpostz = special->z>>FRACBITS;
|
||||
players[i].starpostangle = special->angle;
|
||||
players[i].starpostscale = player->mo->destscale;
|
||||
|
@ -1483,8 +1484,16 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
|||
{
|
||||
// Save the player's time and position.
|
||||
player->starposttime = leveltime;
|
||||
player->starpostx = toucher->x>>FRACBITS;
|
||||
player->starposty = toucher->y>>FRACBITS;
|
||||
if (special->spawnpoint && (special->spawnpoint->options & MTF_AMBUSH))
|
||||
{
|
||||
player->starpostx = special->x>>FRACBITS;
|
||||
player->starposty = special->y>>FRACBITS;
|
||||
}
|
||||
else
|
||||
{
|
||||
player->starpostx = toucher->x>>FRACBITS;
|
||||
player->starposty = toucher->y>>FRACBITS;
|
||||
}
|
||||
player->starpostz = special->z>>FRACBITS;
|
||||
player->starpostangle = special->angle;
|
||||
player->starpostscale = player->mo->destscale;
|
||||
|
|
Loading…
Reference in a new issue