Merge remote-tracking branch 'origin/master' into driftboost

This commit is contained in:
James R 2020-07-19 22:19:59 -07:00
commit 93e0872d9a
5 changed files with 44 additions and 36 deletions

View file

@ -6214,6 +6214,7 @@ static void Follower2_OnChange(void)
} }
{
INT32 num = R_FollowerAvailable(str); INT32 num = R_FollowerAvailable(str);
char set[10]; char set[10];
if (num == -1) // that's an error. if (num == -1) // that's an error.
@ -6222,6 +6223,7 @@ static void Follower2_OnChange(void)
sprintf(set, "%d", num); sprintf(set, "%d", num);
CV_StealthSet(&cv_follower2, set); // set it to a number. It's easier for us to send later :) CV_StealthSet(&cv_follower2, set); // set it to a number. It's easier for us to send later :)
} }
}
SendNameAndColor2(); SendNameAndColor2();
} }
@ -6257,6 +6259,7 @@ static void Follower3_OnChange(void)
return; return;
} }
{
INT32 num = R_FollowerAvailable(str); INT32 num = R_FollowerAvailable(str);
char set[10]; char set[10];
if (num == -1) // that's an error. if (num == -1) // that's an error.
@ -6265,6 +6268,7 @@ static void Follower3_OnChange(void)
sprintf(set, "%d", num); sprintf(set, "%d", num);
CV_StealthSet(&cv_follower3, set); // set it to a number. It's easier for us to send later :) CV_StealthSet(&cv_follower3, set); // set it to a number. It's easier for us to send later :)
} }
}
SendNameAndColor3(); SendNameAndColor3();
} }
@ -6300,6 +6304,7 @@ static void Follower4_OnChange(void)
return; return;
} }
{
INT32 num = R_FollowerAvailable(str); INT32 num = R_FollowerAvailable(str);
char set[10]; char set[10];
if (num == -1) // that's an error. if (num == -1) // that's an error.
@ -6308,6 +6313,7 @@ static void Follower4_OnChange(void)
sprintf(set, "%d", num); sprintf(set, "%d", num);
CV_StealthSet(&cv_follower4, set); // set it to a number. It's easier for us to send later :) CV_StealthSet(&cv_follower4, set); // set it to a number. It's easier for us to send later :)
} }
}
SendNameAndColor4(); SendNameAndColor4();
} }

View file

@ -908,7 +908,7 @@ if (followers[numfollowers].field < threshold) \
FALLBACK(bubblescale, "BUBBLESCALE", 0, 0); // No negative scale FALLBACK(bubblescale, "BUBBLESCALE", 0, 0); // No negative scale
// Special case for color I suppose // Special case for color I suppose
if (followers[numfollowers].defaultcolor < 0 || followers[numfollowers].defaultcolor > MAXSKINCOLORS-1) if (followers[numfollowers].defaultcolor > MAXSKINCOLORS-1)
{ {
followers[numfollowers].defaultcolor = 1; followers[numfollowers].defaultcolor = 1;
deh_warning("Follower \'%s\': Value for 'color' should be between 1 and %d.\n", dname, MAXSKINCOLORS-1); deh_warning("Follower \'%s\': Value for 'color' should be between 1 and %d.\n", dname, MAXSKINCOLORS-1);

View file

@ -484,24 +484,24 @@ boolean K_PathfindAStar(path_t *const path, pathfindsetup_t *const pathfindsetup
// Need to update pointers in closedset, openset, and node "camefrom" if nodesarray moved. // Need to update pointers in closedset, openset, and node "camefrom" if nodesarray moved.
if (nodesarray != nodesarrayrealloc) if (nodesarray != nodesarrayrealloc)
{ {
size_t i = 0U; size_t j = 0U;
size_t arrayindex = 0U; size_t arrayindex = 0U;
for (i = 0U; i < closedsetcount; i++) for (j = 0U; j < closedsetcount; j++)
{ {
arrayindex = closedset[i] - nodesarray; arrayindex = closedset[j] - nodesarray;
closedset[i] = &nodesarrayrealloc[arrayindex]; closedset[j] = &nodesarrayrealloc[arrayindex];
} }
for (i = 0U; i < openset.count; i++) for (j = 0U; j < openset.count; j++)
{ {
arrayindex = ((pathfindnode_t *)(openset.array[i].data)) - nodesarray; arrayindex = ((pathfindnode_t *)(openset.array[j].data)) - nodesarray;
openset.array[i].data = &nodesarrayrealloc[arrayindex]; openset.array[j].data = &nodesarrayrealloc[arrayindex];
} }
for (i = 0U; i < nodesarraycount; i++) for (j = 0U; j < nodesarraycount; j++)
{ {
if (nodesarrayrealloc[i].camefrom != NULL) if (nodesarrayrealloc[j].camefrom != NULL)
{ {
arrayindex = nodesarrayrealloc[i].camefrom - nodesarray; arrayindex = nodesarrayrealloc[j].camefrom - nodesarray;
nodesarrayrealloc[i].camefrom = &nodesarrayrealloc[arrayindex]; nodesarrayrealloc[j].camefrom = &nodesarrayrealloc[arrayindex];
} }
} }

View file

@ -11797,8 +11797,8 @@ void P_RespawnSpecials(void)
ss->sector->ceilingheight) - (mthing->options >> ZSHIFT) * FRACUNIT; ss->sector->ceilingheight) - (mthing->options >> ZSHIFT) * FRACUNIT;
if (mthing->options & MTF_AMBUSH if (mthing->options & MTF_AMBUSH
&& (i == MT_RING || i == MT_REDTEAMRING || i == MT_BLUETEAMRING || i == MT_COIN || P_WeaponOrPanel(i))) && (i == MT_RING || i == MT_REDTEAMRING || i == MT_BLUETEAMRING || i == MT_COIN || P_WeaponOrPanel(i)))
z -= 24*FRACUNIT; z -= 24 * mapobjectscale;
z -= mobjinfo[i].height; // Don't forget the height! z -= FixedMul(mobjinfo[i].height, mapobjectscale); // Don't forget the height!
} }
else else
{ {
@ -11809,7 +11809,7 @@ void P_RespawnSpecials(void)
ss->sector->floorheight) + (mthing->options >> ZSHIFT) * FRACUNIT; ss->sector->floorheight) + (mthing->options >> ZSHIFT) * FRACUNIT;
if (mthing->options & MTF_AMBUSH if (mthing->options & MTF_AMBUSH
&& (i == MT_RING || i == MT_REDTEAMRING || i == MT_BLUETEAMRING || i == MT_COIN || P_WeaponOrPanel(i))) && (i == MT_RING || i == MT_REDTEAMRING || i == MT_BLUETEAMRING || i == MT_COIN || P_WeaponOrPanel(i)))
z += 24*FRACUNIT; z += 24 * mapobjectscale;
} }
mo = P_SpawnMobj(x, y, z, i); mo = P_SpawnMobj(x, y, z, i);

View file

@ -8492,9 +8492,11 @@ static void P_HandleFollower(player_t *player)
// finally, add a cool floating effect to the z height. // finally, add a cool floating effect to the z height.
// not stolen from k_kart I swear!! // not stolen from k_kart I swear!!
{
const fixed_t pi = (22<<FRACBITS) / 7; // loose approximation, this doesn't need to be incredibly precise const fixed_t pi = (22<<FRACBITS) / 7; // loose approximation, this doesn't need to be incredibly precise
fixed_t sine = fl.bobamp * FINESINE((((8*pi*(fl.bobspeed)) * leveltime)>>ANGLETOFINESHIFT) & FINEMASK); fixed_t sine = fl.bobamp * FINESINE((((8*pi*(fl.bobspeed)) * leveltime)>>ANGLETOFINESHIFT) & FINEMASK);
sz += FixedMul(player->mo->scale, sine)*P_MobjFlip(player->mo); sz += FixedMul(player->mo->scale, sine)*P_MobjFlip(player->mo);
}
// Set follower colour // Set follower colour