diff --git a/Source/Client/Defs.h b/Source/Client/Defs.h
index 432bafdd..ef1673ed 100755
--- a/Source/Client/Defs.h
+++ b/Source/Client/Defs.h
@@ -92,6 +92,9 @@ vector vPlayerOrigin;
vector vPlayerOriginOld;
vector vPlayerVelocity;
+vector vPunchAngle;
+
+void View_AddPunchAngle( vector vAdd );
void View_PlayAnimation( int iSequence );
string HUD_GetChatColorHEX( float fTeam );
diff --git a/Source/Client/Draw.c b/Source/Client/Draw.c
index d8269426..51d22c6f 100755
--- a/Source/Client/Draw.c
+++ b/Source/Client/Draw.c
@@ -172,9 +172,12 @@ void CSQC_UpdateView( float fWinWidth, float fWinHeight, float fGameFocus ) {
setproperty( VF_ORIGIN, vPlayerOrigin + [ 0, 0, getstatf( STAT_VIEWHEIGHT ) ] );
setproperty( VF_ANGLES, view_angles );
View_DrawViewModel();
+
}
-
+
+ setproperty( VF_ANGLES, view_angles + vPunchAngle );
renderscene();
+ View_DropPunchAngle();
Nightvision_PostDraw();
diff --git a/Source/Client/Event.c b/Source/Client/Event.c
index f249fe9d..db7cc990 100755
--- a/Source/Client/Event.c
+++ b/Source/Client/Event.c
@@ -610,4 +610,6 @@ void CSQC_Input_Frame( void ) {
if ( iInputDuck == TRUE ) {
input_buttons |= INPUT_BUTTON6;
}
+
+ input_angles += vPunchAngle;
}
diff --git a/Source/Client/Player.c b/Source/Client/Player.c
index 68f1df63..3f4ce5a7 100755
--- a/Source/Client/Player.c
+++ b/Source/Client/Player.c
@@ -73,6 +73,7 @@ void Player_Draw( void ) {
self.baseframe2time += frametime;
self.frame2time += frametime;
}
+
/*
=================
Player_PreDraw
diff --git a/Source/Client/VGUIMOTD.c b/Source/Client/VGUIMOTD.c
index afc039a2..db380c85 100755
--- a/Source/Client/VGUIMOTD.c
+++ b/Source/Client/VGUIMOTD.c
@@ -42,7 +42,9 @@ void VGUI_MessageOfTheDay( vector vPos ) {
vector vTextPos = vPos + '16 116 0';
for ( int i = 0; i < 25; i++ ) {
- VGUI_Text( sMOTDString[ i ], vTextPos, '8 8', FONT_DEFAULT );
+ if ( sMOTDString[ i ] != "/" ) {
+ VGUI_Text( sMOTDString[ i ], vTextPos, '8 8', FONT_DEFAULT );
+ }
vTextPos_y += 10;
}
diff --git a/Source/Client/View.c b/Source/Client/View.c
index d870ea50..737fda75 100755
--- a/Source/Client/View.c
+++ b/Source/Client/View.c
@@ -89,6 +89,16 @@ float View_CalcBob( void ) {
return fBob;
}
+void View_DropPunchAngle( void ) {
+ float fLerp;
+ fLerp = 1.0f - ( frametime * 4 );
+ vPunchAngle *= fLerp;
+}
+
+void View_AddPunchAngle( vector vAdd ) {
+ vPunchAngle += vAdd;
+}
+
/*
====================
View_ProcessEvent
diff --git a/Source/FreeCS-CE.prj b/Source/FreeCS-CE.prj
index 2f04e5dd..08567498 100644
--- a/Source/FreeCS-CE.prj
+++ b/Source/FreeCS-CE.prj
@@ -1,5 +1,5 @@
-
+
@@ -25,7 +25,7 @@
-
+
@@ -60,7 +60,7 @@
-
+
@@ -72,8 +72,9 @@
-
+
+
@@ -114,13 +115,5 @@
-
-
-
-
-
-
-
-
diff --git a/Source/Math.h b/Source/Math.h
index aeb145a9..e8a46f3e 100644
--- a/Source/Math.h
+++ b/Source/Math.h
@@ -29,6 +29,28 @@ float Math_Lerp( float fA, float fB, float fPercent ) {
return ( fA * ( 1 - fPercent ) ) + ( fB * fPercent );
}
+float Math_VectorNormalize( vector v ) {
+ float length, ilength;
+
+ length = v_x*v_x + v_y*v_y + v_z*v_z;
+ length = sqrt( length ); // FIXME
+
+ if ( length ) {
+ ilength = 1 / length;
+ v[0] *= ilength;
+ v[1] *= ilength;
+ v[2] *= ilength;
+ }
+
+ return length;
+}
+
+void Math_VectorScale( vector in, float scale, __inout vector out ) {
+ out_x = in_x * scale;
+ out_y = in_y * scale;
+ out_z = in_z * scale;
+}
+
float Math_FixDelta( float fDelta ) {
if ( fDelta >= 180 ) {
fDelta -= 360;
diff --git a/Source/Menu/MenuMultiplayer.c b/Source/Menu/MenuMultiplayer.c
index 48943cbc..77408919 100644
--- a/Source/Menu/MenuMultiplayer.c
+++ b/Source/Menu/MenuMultiplayer.c
@@ -134,10 +134,10 @@ void Menu_Multiplayer( void ) {
//sethostcachemaskstring( 0, gethostcacheindexforkey( "gamedir" ), "freecs", SLIST_TEST_EQUAL );
sethostcachesort( gethostcacheindexforkey( "ping" ), FALSE );
refreshhostcache();
- resorthostcache();
iSelectedServer = -2;
}
+ resorthostcache();
fldName = gethostcacheindexforkey("name");
fldAddress = gethostcacheindexforkey("cname");
fldPing = gethostcacheindexforkey("ping");
diff --git a/Source/Server/Defs.h b/Source/Server/Defs.h
index 1a2935ad..19a95e75 100755
--- a/Source/Server/Defs.h
+++ b/Source/Server/Defs.h
@@ -28,6 +28,7 @@ var float autocvar_mp_freezetime = 6;
var float autocvar_mp_c4timer = 45;
var float autocvar_mp_roundtime = 5;
var float autocvar_mp_fillweapons = 0;
+var string autocvar_motdfile = "motd.txt";
// Hit Group standards
enum {
diff --git a/Source/Server/Main.c b/Source/Server/Main.c
index 030ebe23..c55728d4 100755
--- a/Source/Server/Main.c
+++ b/Source/Server/Main.c
@@ -157,13 +157,18 @@ void worldspawn( void ) {
}
// The message of the day.
- filestream fmMOTD = fopen( "motd.txt", FILE_READ );
+ filestream fmMOTD = fopen( autocvar_motdfile, FILE_READ );
for ( int i = 0; i < 25; i++ ) {
sTemp = fgets( fmMOTD );
if not ( sTemp ) {
break;
}
- localcmd( sprintf( "serverinfo motdline%i %s\n", iMOTDLines, sTemp ) );
+
+ if ( sTemp == __NULL__ ) {
+ localcmd( sprintf( "serverinfo motdline%i /\n", iMOTDLines ) );
+ } else {
+ localcmd( sprintf( "serverinfo motdline%i %s\n", iMOTDLines, sTemp ) );
+ }
iMOTDLines++;
}
localcmd( sprintf( "serverinfo motdlength %i\n", iMOTDLines ) );
diff --git a/Source/Shared/BaseGun.c b/Source/Shared/BaseGun.c
index 0049ce9a..8a356c55 100755
--- a/Source/Shared/BaseGun.c
+++ b/Source/Shared/BaseGun.c
@@ -71,11 +71,16 @@ void BaseGun_ShotMultiplierHandle( float fShots ) {
}
self.fDecreaseShotTime = time + 0.2;
#else
+ vector vPunch;
if ( iShotMultiplier > 12 ) {
iShotMultiplier = 12;
} else {
iShotMultiplier += fShots;
}
+
+ vPunch_x = -2 * ( iShotMultiplier / 6 );
+ vPunch_y = random( -1, 1 );
+ View_AddPunchAngle( vPunch );
#endif
}
diff --git a/freecs/csprogs.dat b/freecs/csprogs.dat
index c7053fd0..bf6c6cff 100644
Binary files a/freecs/csprogs.dat and b/freecs/csprogs.dat differ
diff --git a/freecs/ftesrv.cfg b/freecs/ftesrv.cfg
index 28371b50..9a4ee445 100755
--- a/freecs/ftesrv.cfg
+++ b/freecs/ftesrv.cfg
@@ -9,6 +9,7 @@ seta mp_freezetime 6
seta mp_c4timer 45
seta mp_roundtime 5
seta mp_fillweapons 0
+seta motdfile "motd.txt" // In case you want to use a different Message Of The Day
// Physics
seta pm_bunnyspeedcap "1"
@@ -18,7 +19,6 @@ seta sv_maxspeed 240
// Misc
seta com_nogamedirnativecode "0"
-
// for now, because people don't seem to be able to install things properly
seta allow_download_maps "0"
seta allow_download_models "0"
diff --git a/freecs/menu.dat b/freecs/menu.dat
index 5d60ca81..a69d3e41 100755
Binary files a/freecs/menu.dat and b/freecs/menu.dat differ
diff --git a/freecs/progs.dat b/freecs/progs.dat
index 85eac3e0..da233e4c 100644
Binary files a/freecs/progs.dat and b/freecs/progs.dat differ