a better implementation for "slowmove" -> "flyspeed"

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6447 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Bukz
2011-05-17 13:46:44 +00:00
parent 1ceb287e00
commit 2fc7069551
4 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -974,8 +974,8 @@ docident [old_editbinds] [Enables or disables the old editing binds.];
docexample [old_editbinds = 0] [disables the old editing binds];
docexample [old_editbinds = 1] [enables the old editing binds];
docremark [If disabled, an updated editing binds system is used, see the comments in "/config/resetbinds.cfg" for more info.];
docident [slowmove] [Enables or disables the old editfly velocity.];
docargument [N] [0 off, 1 on] [min 0/max 1/default 0] [0];
docident [flyspeed] [Determines by how much to multiply the fly speeds by.];
docargument [N] [the multiplicand] [min 1.0/max 5.0/default 2.0] [0];
docident [oldselstyle] [Enables or disables using triangles to render the editing grid/current selection instead of squares.];
docargument [N] [0 off, 1 on] [min 0/max 1/default 1] [0];
docsection [Menus]
+1 -1
View File
@@ -375,7 +375,7 @@ cleanshot = [
]
// Slowtoggle - Meant to be keybound, quickly toggle from fast/slow fly speeds.
slowtoggle = [ if (!= $arg1 0) [ slowmove 0; onrelease [ slowmove 1 ] ] [ slowmove 1; onrelease [ slowmove 0 ] ] ]
slowtoggle = [ if (!= $arg1 0) [ flyspeed 2.0; onrelease [ flyspeed 1.0 ] ] [ flyspeed 1.0; onrelease [ flyspeed 2.0 ] ] ]
votepending = 0
if (! (checkalias onCallVote)) [ onCallVote = "" ]; if (! (strstr $onCallVote votepending)) [ add2alias onCallVote [ votepending = 1 ] ]
+3 -3
View File
@@ -3943,9 +3943,9 @@ Output:
<description>If this alias exists, it will be automatically executed when you start a new map.</description>
</scriptalias>
<variable name="slowmove">
<description>Enables or disables the old editfly velocity.</description>
<value token="N" description="0 off, 1 on" minValue="0" maxValue="1" defaultValue="0"/>
<variable name="flyspeed">
<description>Determines by how much to multiply the fly speeds by.</description>
<value token="N" description="the multiplier" minValue="1.0" maxValue="5.0" defaultValue="2.0"/>
</variable>
<variable name="oldselstyle">
+2 -2
View File
@@ -321,7 +321,7 @@ float var_f = 0;
int var_i = 0;
bool var_b = true;
VARP(slowmove, 0, 0, 1);
FVARP(flyspeed, 1.0, 2.0, 5.0);
void moveplayer(physent *pl, int moveres, bool local, int curtime)
{
@@ -375,7 +375,7 @@ void moveplayer(physent *pl, int moveres, bool local, int curtime)
if(!(pl->onfloor || pl->onladder)) chspeed = 1.0f;
const bool crouching = pl->crouching || pl->eyeheight < pl->maxeyeheight;
const float speed = curtime/(water ? 2000.0f : 1000.0f)*pl->maxspeed*(crouching && pl->state != CS_EDITING ? chspeed : 1.0f)*(pl==player1 && isfly && !slowmove ? 2.0f : 1.0f);
const float speed = curtime/(water ? 2000.0f : 1000.0f)*pl->maxspeed*(crouching && pl->state != CS_EDITING ? chspeed : 1.0f)*(pl==player1 && isfly ? flyspeed : 1.0f);
const float friction = water ? 20.0f : (pl->onfloor || isfly ? 6.0f : (pl->onladder ? 1.5f : 30.0f));
const float fpsfric = max(friction/curtime*20.0f, 1.0f);