- A_SetPitch now clamps the player's pitch within the valid range. It can
be made to clamp other actors' pitches to within the range (-90,+90) degrees with the SPF_FORCECLAMP flag. - Transmit the local viewpitch limits to the other players. SVN r3323 (trunk)
This commit is contained in:
parent
0897a593c7
commit
b41dbf8a52
11 changed files with 63 additions and 13 deletions
|
|
@ -3416,10 +3416,34 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetAngle)
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
enum
|
||||
{
|
||||
SPF_FORCECLAMP = 1, // players always clamp
|
||||
};
|
||||
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetPitch)
|
||||
{
|
||||
ACTION_PARAM_START(1);
|
||||
ACTION_PARAM_START(2);
|
||||
ACTION_PARAM_ANGLE(pitch, 0);
|
||||
ACTION_PARAM_INT(flags, 1);
|
||||
|
||||
if (self->player != NULL || (flags & SPF_FORCECLAMP))
|
||||
{ // clamp the pitch we set
|
||||
int min, max;
|
||||
|
||||
if (self->player != NULL)
|
||||
{
|
||||
min = self->player->MinPitch;
|
||||
max = self->player->MaxPitch;
|
||||
}
|
||||
else
|
||||
{
|
||||
min = -ANGLE_90 + (1 << ANGLETOFINESHIFT);
|
||||
max = ANGLE_90 - (1 << ANGLETOFINESHIFT);
|
||||
}
|
||||
pitch = clamp<int>(pitch, min, max);
|
||||
}
|
||||
|
||||
self->pitch = pitch;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue