diff --git a/source/src/cube.h b/source/src/cube.h index 77937834..edd269e6 100644 --- a/source/src/cube.h +++ b/source/src/cube.h @@ -326,8 +326,8 @@ enum // function signatures for script functions, see command.cpp #define WIN32_LEAN_AND_MEAN #include "windows.h" #define _WINDOWS - #define ZLIB_DLL - #define cos(x) cos((float)(x)) + #define ZLIB_DLL + #define cos(x) cos((float)(x)) #define sin(x) sin((float)(x)) #else #include diff --git a/source/src/entities.cpp b/source/src/entities.cpp index 5269c666..f7e157cc 100644 --- a/source/src/entities.cpp +++ b/source/src/entities.cpp @@ -252,14 +252,14 @@ void item(int num) if (num==7) { player1->hasarmour=!player1->hasarmour; /*toggle armour*/ }; -}; - -void primary(int num) -{ - if(num>0 && num<7) player1->primary = num; - radd(player1); -} - +}; -COMMAND(item,ARG_1INT); +void primary(int num) +{ + if(num>0 && num<7) player1->primary = num; + radd(player1); +} + + +COMMAND(item,ARG_1INT); COMMAND(primary,ARG_1INT); diff --git a/source/src/rendermd3.cpp b/source/src/rendermd3.cpp index d505a6a0..98fea7cb 100644 --- a/source/src/rendermd3.cpp +++ b/source/src/rendermd3.cpp @@ -398,8 +398,8 @@ void loadweapons() }; void rotatevec(vec &point, vec &rot) -{ - vec tmp(point); +{ + vec tmp(point); point.x=tmp.z*sin(rot.x)+tmp.x*cos(rot.x); point.y=tmp.y; @@ -412,10 +412,10 @@ void rotatevec(vec &point, vec &rot) point.x=tmp.y*sin(rot.z)+tmp.x*cos(rot.z); point.y=tmp.y*cos(rot.z)-tmp.x*sin(rot.z); point.z=tmp.z; -}; - -VAR(swayspeeddiv, 1, 200, 1000); -VAR(swaymovediv, 1, 10, 1000); +}; + +VAR(swayspeeddiv, 1, 200, 1000); +VAR(swaymovediv, 1, 10, 1000); void rendermd3gun() { @@ -463,15 +463,15 @@ void rendermd3gun() float k_back = kick_back(player1->gunselect)*kick/10; vec sway(unitv); - int swayt = (lastmillis+1)/10 % 100; - float swayspeed = (float) sin((float)lastmillis/swayspeeddiv)/swaymovediv; - - float plspeed = min(1.0f, 0.1f + sqrt(player1->vel.x*player1->vel.x + player1->vel.y*player1->vel.y)); + int swayt = (lastmillis+1)/10 % 100; + float swayspeed = (float) sin((float)lastmillis/swayspeeddiv)/swaymovediv; + + float plspeed = min(1.0f, 0.1f + sqrt(player1->vel.x*player1->vel.x + player1->vel.y*player1->vel.y)); swayspeed *= plspeed/2; - vec rot = {0.0f, 0.0f, 1.0f}; + vec rot = {0.0f, 0.0f, 1.0f}; - rotatevec(sway, rot); + rotatevec(sway, rot); sway.x*=swayspeed; sway.y*=swayspeed;