#108 merged 'Pause' PR - work in progress

This commit is contained in:
drian
2021-04-14 09:19:22 +02:00
parent 3546e7bcb5
commit 7d0e84fe95
12 changed files with 114 additions and 22 deletions
+4 -5
View File
@@ -767,8 +767,7 @@ void moveplayer(physent *pl, int moveres, bool local, int curtime)
// apply volume-resize when crouching
if(pl->type==ENT_PLAYER || pl->type==ENT_BOT)
{
// if(pl==player1 && !(intermission || player1->onladder || (pl->trycrouch && !player1->onfloor && player1->timeinair > 50))) updatecrouch(player1, player1->trycrouch);
if(!intermission && (pl == player1 || pl->type == ENT_BOT)) updatecrouch((playerent *)pl, pl->trycrouch);
if(!intermission && !ispaused && (pl == player1 || pl->type == ENT_BOT)) updatecrouch((playerent *)pl, pl->trycrouch);
const float croucheyeheight = pl->maxeyeheight*3.0f/4.0f;
resizephysent(pl, moveres, curtime, croucheyeheight, pl->maxeyeheight);
}
@@ -848,7 +847,7 @@ dir(right, strafe, -1, k_right, k_left)
void attack(bool on)
{
if(intermission) return;
if(intermission || (ispaused && player1->state == CS_ALIVE)) return;
if(editmode) editdrag(on);
else if(player1->state==CS_DEAD || player1->state==CS_SPECTATE)
{
@@ -860,7 +859,7 @@ void attack(bool on)
void jumpn(bool on)
{
static bool wason = false;
player1->jumpnext = on && !wason && !player1->crouching && !intermission && !player1->isspectating();
player1->jumpnext = on && !wason && !player1->crouching && !intermission && !player1->isspectating() && !ispaused;
wason = on;
if(player1->isspectating())
{
@@ -914,7 +913,7 @@ FVARP(mfilter, 0.0f, 0.0f, 6.0f); // simple lowpass filtering (zer
void mousemove(int idx, int idy)
{
if(intermission || (player1->isspectating() && player1->spectatemode==SM_FOLLOW1ST)) return;
if(intermission || (ispaused && player1->state == CS_ALIVE) || (player1->isspectating() && player1->spectatemode==SM_FOLLOW1ST)) return;
bool zooming = player1->weaponsel->type == GUN_SNIPER && ((sniperrifle *)player1->weaponsel)->scoped; // check if player uses scope
float dx = idx, dy = idy;
if(mfilter > 0.0001f)