water movement speed fixed, xhair in editmode

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1859 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
driAn
2008-05-04 11:32:25 +00:00
parent 03f608c346
commit b7ef791035
2 changed files with 9 additions and 5 deletions
+8 -4
View File
@@ -250,10 +250,6 @@ void moveplayer(physent *pl, int moveres, bool local, int curtime)
bool water = false;
const bool editfly = (editmode && local) || pl->state==CS_EDITING;
const bool specfly = local && pl->type==ENT_PLAYER && ((playerent *)pl)->spectating==SM_FLY;
const float speed = curtime/(water ? 2000.0f : 1000.0f)*pl->maxspeed*(pl->crouching ? 0.5f : 1.0f);
const float friction = water ? 20.0f : (pl->onfloor || editfly || specfly ? 6.0f : (pl->onladder ? 1.5f : 30.0f));
const float fpsfric = friction/curtime*20.0f;
vec d; // vector of direction we ideally want to move in
@@ -265,6 +261,10 @@ void moveplayer(physent *pl, int moveres, bool local, int curtime)
drop = rise = 0;
water = hdr.waterlevel>pl->o.z;
const float speed = curtime/(water ? 2000.0f : 1000.0f)*pl->maxspeed;
const float friction = water ? 20.0f : (pl->onfloor || editfly || specfly ? 6.0f : 30.0f);
const float fpsfric = friction/curtime*20.0f;
if(pl->onfloor) // apply friction
{
pl->vel.mul(fpsfric-1);
@@ -292,6 +292,10 @@ void moveplayer(physent *pl, int moveres, bool local, int curtime)
int move = pl->onladder && !pl->onfloor && pl->move == -1 ? 0 : pl->move; // movement on ladder
water = hdr.waterlevel>pl->o.z-0.5f;
const float speed = curtime/(water ? 2000.0f : 1000.0f)*pl->maxspeed*(pl->crouching ? 0.5f : 1.0f);
const float friction = water ? 20.0f : (pl->onfloor || editfly || specfly ? 6.0f : (pl->onladder ? 1.5f : 30.0f));
const float fpsfric = friction/curtime*20.0f;
d.x = (float)(move*cosf(RAD*(pl->yaw-90)));
d.y = (float)(move*sinf(RAD*(pl->yaw-90)));
d.z = 0.0f;
+1 -1
View File
@@ -400,7 +400,7 @@ void gl_drawhud(int w, int h, int curfps, int nquads, int curvert, bool underwat
bool menu = menuvisible();
bool command = getcurcommand() ? true : false;
if(player1->state==CS_ALIVE && !player1->weaponsel->reloading && !menu)
if((player1->state==CS_ALIVE || player1->state==CS_EDITING) && !player1->weaponsel->reloading && !menu)
{
bool drawteamwarning = targetplayer ? (isteam(targetplayer->team, player1->team) && targetplayer->state!=CS_DEAD) : false;
player1->weaponsel->renderaimhelp(drawteamwarning);