mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Declare checkbase for both sides of the if statement
This commit is contained in:
parent
fa8efa97e4
commit
75741d6ac8
1 changed files with 37 additions and 42 deletions
|
|
@ -1451,9 +1451,11 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||||
if (player->starpostnum >= special->health)
|
if (player->starpostnum >= special->health)
|
||||||
return; // Already hit this post
|
return; // Already hit this post
|
||||||
|
|
||||||
if (cv_coopstarposts.value && G_GametypeUsesCoopStarposts() && (netgame || multiplayer))
|
|
||||||
{
|
{
|
||||||
mobj_t *checkbase = (special->spawnpoint && (special->spawnpoint->options & MTF_AMBUSH)) ? special : toucher;
|
mobj_t *checkbase = (special->spawnpoint && (special->spawnpoint->options & MTF_AMBUSH)) ? special : toucher;
|
||||||
|
|
||||||
|
if (cv_coopstarposts.value && G_GametypeUsesCoopStarposts() && (netgame || multiplayer))
|
||||||
|
{
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
{
|
{
|
||||||
if (playeringame[i])
|
if (playeringame[i])
|
||||||
|
|
@ -1484,16 +1486,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||||
{
|
{
|
||||||
// Save the player's time and position.
|
// Save the player's time and position.
|
||||||
player->starposttime = leveltime;
|
player->starposttime = leveltime;
|
||||||
if (special->spawnpoint && (special->spawnpoint->options & MTF_AMBUSH))
|
player->starpostx = checkbase->x>>FRACBITS;
|
||||||
{
|
player->starposty = checkbase->y>>FRACBITS;
|
||||||
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->starpostz = special->z>>FRACBITS;
|
||||||
player->starpostangle = special->angle;
|
player->starpostangle = special->angle;
|
||||||
player->starpostscale = player->mo->destscale;
|
player->starpostscale = player->mo->destscale;
|
||||||
|
|
@ -1505,6 +1499,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||||
player->starpostnum = special->health;
|
player->starpostnum = special->health;
|
||||||
S_StartSound(toucher, special->info->painsound);
|
S_StartSound(toucher, special->info->painsound);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
P_ClearStarPost(special->health);
|
P_ClearStarPost(special->health);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue