summaryrefslogtreecommitdiff
path: root/src/engine/physics.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/physics.cpp')
-rw-r--r--src/engine/physics.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/engine/physics.cpp b/src/engine/physics.cpp
index 868bcc1..17dfb37 100644
--- a/src/engine/physics.cpp
+++ b/src/engine/physics.cpp
@@ -1083,12 +1083,6 @@ void falling(physent *d, vec &dir, const vec &floor) {
}
void landing(physent *d, vec &dir, const vec &floor, bool collided) {
-#if 0
- if(d->physstate == PHYS_FALL) {
- d->timeinair = 0;
- if(dir.z < 0.0f) dir.z = d->vel.z = 0.0f;
- }
-#endif
switchfloor(d, dir, floor);
d->timeinair = 0;
if((d->physstate!=PHYS_STEP_UP && d->physstate!=PHYS_STEP_DOWN) || !collided)
@@ -1310,7 +1304,7 @@ FVAR(straferoll, 0, 0.033f, 90);
FVAR(faderoll, 0, 0.95f, 1);
VAR(floatspeed, 1, 100, 10000);
-void modifyvelocity(physent *pl, bool local, bool floating, int curtime) {
+void modifyvelocity(physent *pl, bool floating, int curtime) {
bool allowmove = game::allowmove(pl);
if(floating) {
if(pl->jumping && allowmove) {
@@ -1371,13 +1365,14 @@ void modifygravity(physent *pl, int curtime) {
// local is false for multiplayer prediction
bool moveplayer(physent *pl, int moveres, bool local, int curtime) {
+ (void) local;
int material = lookupmaterial(vec(pl->o.x, pl->o.y, pl->o.z + (3*pl->aboveeye - pl->eyeheight)/4));
bool floating = pl->type==ENT_PLAYER && (pl->state==CS_EDITING || pl->state==CS_SPECTATOR);
float secs = curtime/1000.f;
// apply gravity
if(!floating) modifygravity(pl, curtime);
// apply any player generated changes in velocity
- modifyvelocity(pl, local, floating, curtime);
+ modifyvelocity(pl, floating, curtime);
vec d(pl->vel);
if(!floating) d.mul(0.5f);
d.add(pl->falling);
@@ -1390,8 +1385,7 @@ bool moveplayer(physent *pl, int moveres, bool local, int curtime) {
pl->falling = vec(0, 0, 0);
}
pl->o.add(d);
- }
- else { // apply velocity with collision {
+ } else { // apply velocity with collision {
const float f = 1.0f/moveres;
const int timeinair = pl->timeinair;
int collisions = 0;