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:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user