Followers compiler warnings

This commit is contained in:
James R 2020-07-09 16:39:47 -07:00
parent 8399079f35
commit f1648fbf5c
3 changed files with 30 additions and 22 deletions

View file

@ -6214,13 +6214,15 @@ static void Follower2_OnChange(void)
} }
INT32 num = R_FollowerAvailable(str); {
char set[10]; INT32 num = R_FollowerAvailable(str);
if (num == -1) // that's an error. char set[10];
CONS_Alert(CONS_WARNING, M_GetText("Follower '%s' not found\n"), str); if (num == -1) // that's an error.
CONS_Alert(CONS_WARNING, M_GetText("Follower '%s' not found\n"), str);
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,13 +6259,15 @@ static void Follower3_OnChange(void)
return; return;
} }
INT32 num = R_FollowerAvailable(str); {
char set[10]; INT32 num = R_FollowerAvailable(str);
if (num == -1) // that's an error. char set[10];
CONS_Alert(CONS_WARNING, M_GetText("Follower '%s' not found\n"), str); if (num == -1) // that's an error.
CONS_Alert(CONS_WARNING, M_GetText("Follower '%s' not found\n"), str);
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,13 +6304,15 @@ static void Follower4_OnChange(void)
return; return;
} }
INT32 num = R_FollowerAvailable(str); {
char set[10]; INT32 num = R_FollowerAvailable(str);
if (num == -1) // that's an error. char set[10];
CONS_Alert(CONS_WARNING, M_GetText("Follower '%s' not found\n"), str); if (num == -1) // that's an error.
CONS_Alert(CONS_WARNING, M_GetText("Follower '%s' not found\n"), str);
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

@ -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 {
fixed_t sine = fl.bobamp * FINESINE((((8*pi*(fl.bobspeed)) * leveltime)>>ANGLETOFINESHIFT) & FINEMASK); const fixed_t pi = (22<<FRACBITS) / 7; // loose approximation, this doesn't need to be incredibly precise
sz += FixedMul(player->mo->scale, sine)*P_MobjFlip(player->mo); fixed_t sine = fl.bobamp * FINESINE((((8*pi*(fl.bobspeed)) * leveltime)>>ANGLETOFINESHIFT) & FINEMASK);
sz += FixedMul(player->mo->scale, sine)*P_MobjFlip(player->mo);
}
// Set follower colour // Set follower colour