diff --git a/Source/client/entry.c b/Source/client/entry.c index bfe027ab..deea2e7f 100644 --- a/Source/client/entry.c +++ b/Source/client/entry.c @@ -183,6 +183,16 @@ void CSQC_UpdateView(float w, float h, float focus) setproperty(VF_ANGLES, view_angles + pSeat->vPunchAngle); setproperty(VF_DRAWWORLD, 1); renderscene(); + + pl.w_attack_next -= clframetime; + pl.w_idle_next -= clframetime; + + if (pl.w_attack_next <= 0) { + pl.w_attack_next = 0; + } + if (pl.w_idle_next <= 0) { + pl.w_idle_next = 0; + } View_DropPunchAngle(); Fade_Update((int)video_mins[0],(int)video_mins[1], (int)w, (int)h); @@ -336,8 +346,6 @@ void CSQC_Input_Frame(void) if (pSeat->iInputDuck == TRUE) { input_buttons |= INPUT_BUTTON8; } - - Game_Input(); } @@ -601,6 +609,9 @@ void CSQC_WorldLoaded(void) precache_pic("{bigshot3", TRUE); precache_pic("{bigshot4", TRUE); precache_pic("{bigshot5", TRUE); + precache_pic("{scorch1", TRUE); + precache_pic("{scorch2", TRUE); + precache_pic("{scorch3", TRUE); } /* diff --git a/Source/client/predict.c b/Source/client/predict.c index 0f1bcc84..805c0917 100644 --- a/Source/client/predict.c +++ b/Source/client/predict.c @@ -21,11 +21,6 @@ void Predict_PreFrame(player pl) pl.netvelocity = pl.velocity; pl.netflags = pl.flags; -#ifdef VALVE - pl.net_w_attack_next = pl.w_attack_next; - pl.net_w_idle_next = pl.w_idle_next; -#endif - //self.netpmove_flags = self.pmove_flags; //we want to predict an exact copy of the data in the new packet @@ -64,11 +59,6 @@ void Predict_PostFrame(player pl) pl.velocity = pl.netvelocity; pl.flags = pl.netflags; -#ifdef VALVE - pl.w_attack_next = pl.net_w_attack_next; - pl.w_idle_next = pl.net_w_idle_next; -#endif - //self.pmove_flags = self.netpmove_flags; setorigin(pl, pl.origin); //self.pmove_frame = servercommandframe + 1; diff --git a/Source/client/valve/player.c b/Source/client/valve/player.c index 02cfe2e8..aa42ed01 100644 --- a/Source/client/valve/player.c +++ b/Source/client/valve/player.c @@ -40,7 +40,7 @@ void Player_ReadEntity(float flIsNew) pl.a_ammo1 = readbyte(); pl.a_ammo2 = readbyte(); pl.a_ammo3 = readbyte(); - pl.w_attack_next = readfloat(); - pl.w_idle_next = readfloat(); + //pl.w_attack_next = readfloat(); + //pl.w_idle_next = readfloat(); setorigin( pl, pl.origin ); } diff --git a/Source/server/cstrike/defs.h b/Source/server/cstrike/defs.h index 0a1f9e0f..d2e28a69 100755 --- a/Source/server/cstrike/defs.h +++ b/Source/server/cstrike/defs.h @@ -110,8 +110,6 @@ void Ammo_AutoFill(float fWeapon); void Ammo_BuyPrimary(void); void Ammo_BuySecondary(void); -void Input_Handle( void ); - void Animation_PlayerTop( float fFrame ); void Animation_PlayerTopTemp( float fFrame, float fTime ); diff --git a/Source/server/cstrike/input.c b/Source/server/cstrike/input.c index 0aa1b4ca..02326307 100644 --- a/Source/server/cstrike/input.c +++ b/Source/server/cstrike/input.c @@ -13,7 +13,7 @@ Input_Handle Handles impulse and whatnot ================= */ -void Input_Handle(void) +void Game_Input(void) { // Dead, specatator if (self.health <= 0) { diff --git a/Source/server/defs.h b/Source/server/defs.h index ed2b9cd1..56982f1d 100644 --- a/Source/server/defs.h +++ b/Source/server/defs.h @@ -16,6 +16,7 @@ void TraceAttack_FireBullets( int iShots, vector vPos, int iDamage); void Damage_Radius( vector vOrigin, entity eAttacker, float fDamage, float fRadius, int iCheckClip ); void Damage_Apply( entity eTarget, entity eAttacker, float fDamage, vector vHitPos, int iSkipArmor ); void Client_TriggerCamera( entity eTarget, vector vPos, vector vEndPos, float fResetTime ); +void Game_Input(void); entity eActivator; diff --git a/Source/server/entry.c b/Source/server/entry.c index 1e9de382..6dae2cf8 100644 --- a/Source/server/entry.c +++ b/Source/server/entry.c @@ -51,7 +51,6 @@ void PutClientInServer(void) void PlayerPreThink(void) { Game_PlayerPreThink(); - Input_Handle(); } void PlayerPostThink(void) diff --git a/Source/server/valve/client.c b/Source/server/valve/client.c index 0427105f..ee64380f 100644 --- a/Source/server/valve/client.c +++ b/Source/server/valve/client.c @@ -28,6 +28,16 @@ void Game_PlayerPreThink(void) } void Game_PlayerPostThink(void) { + player pl = (player)self; + pl.w_attack_next -= input_timelength; + pl.w_idle_next -= input_timelength; + + if (pl.w_attack_next <= 0) { + pl.w_attack_next = 0; + } + if (pl.w_idle_next <= 0) { + pl.w_idle_next = 0; + } self.SendFlags = 1; } void Game_RunClientCommand(void) diff --git a/Source/server/valve/input.c b/Source/server/valve/input.c index 04ac9a73..acbcc590 100644 --- a/Source/server/valve/input.c +++ b/Source/server/valve/input.c @@ -13,7 +13,7 @@ Input_Handle Handles impulse and whatnot ================= */ -void Input_Handle(void) +void Game_Input(void) { if (self.button0) { Weapons_Primary(); @@ -49,6 +49,15 @@ void Input_Handle(void) Weapons_AddItem(pl, WEAPON_TRIPMINE); Weapons_AddItem(pl, WEAPON_SNARK); } + + if (self.impulse == 102) { + // Respawn all the entities + for (entity a = world; (a = findfloat(a, gflags, GF_CANRESPAWN));) { + CBaseEntity caw = (CBaseEntity)a; + caw.Respawn(); + } + bprint(PRINT_HIGH, "Respawning all map entities...\n"); + } } self.impulse = 0; diff --git a/Source/server/valve/player.c b/Source/server/valve/player.c index b7b835d4..95376b8d 100644 --- a/Source/server/valve/player.c +++ b/Source/server/valve/player.c @@ -111,8 +111,8 @@ float Player_SendEntity(entity ePEnt, float fChanged) WriteByte(MSG_ENTITY, pl.a_ammo1); WriteByte(MSG_ENTITY, pl.a_ammo2); WriteByte(MSG_ENTITY, pl.a_ammo3); - WriteFloat(MSG_ENTITY, pl.w_attack_next); - WriteFloat(MSG_ENTITY, pl.w_idle_next); + //WriteFloat(MSG_ENTITY, pl.w_attack_next); + //WriteFloat(MSG_ENTITY, pl.w_idle_next); return TRUE; } diff --git a/Source/shared/decals.c b/Source/shared/decals.c index e1e0f4f3..7f1643d3 100644 --- a/Source/shared/decals.c +++ b/Source/shared/decals.c @@ -52,3 +52,15 @@ void Decals_PlaceBig(vector pos) decal.nextthink = time /*+ 0.1f*/; #endif } +void Decals_PlaceScorch(vector pos) +{ +#ifdef CSQC + // TODO +#else + entity decal = Decals_Next(); + setorigin(decal, pos); + decal.texture = sprintf("{scorch%d", floor(random(1,3))); + decal.think = infodecal; + decal.nextthink = time /*+ 0.1f*/; +#endif +} diff --git a/Source/shared/effects.c b/Source/shared/effects.c index 147a978f..76ea7469 100755 --- a/Source/shared/effects.c +++ b/Source/shared/effects.c @@ -31,6 +31,7 @@ void Effect_CreateExplosion( vector vPos ) { eExplosion.nextthink = time + 0.05f; te_explosion( vPos ); + Decals_PlaceScorch(vPos); #endif } diff --git a/Source/shared/pmove.c b/Source/shared/pmove.c index 77ebbfaf..45524fb3 100644 --- a/Source/shared/pmove.c +++ b/Source/shared/pmove.c @@ -675,20 +675,10 @@ void PMove_Run(void) if (input_buttons & INPUT_BUTTON5) { input_movevalues *= 0.50; } - - player pl = (player)self; - - pl.w_attack_next -= input_timelength; - pl.w_idle_next -= input_timelength; - - if (pl.w_attack_next <= 0) { - pl.w_attack_next = 0; - } - if (pl.w_idle_next <= 0) { - pl.w_idle_next = 0; - } #endif + Game_Input(); + PMove_WaterMove(); if (self.waterlevel >= 2) { diff --git a/cstrike/csprogs.dat b/cstrike/csprogs.dat index 1324ff98..900e1095 100644 Binary files a/cstrike/csprogs.dat and b/cstrike/csprogs.dat differ diff --git a/cstrike/progs.dat b/cstrike/progs.dat index ab18bdea..09d8afd1 100644 Binary files a/cstrike/progs.dat and b/cstrike/progs.dat differ diff --git a/valve/csprogs.dat b/valve/csprogs.dat index 77c80fe0..2f96e7f3 100644 Binary files a/valve/csprogs.dat and b/valve/csprogs.dat differ diff --git a/valve/progs.dat b/valve/progs.dat index 446e356e..56fdbf30 100644 Binary files a/valve/progs.dat and b/valve/progs.dat differ