diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index 7cae56ac..a7af254a 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -238,7 +238,7 @@ void checkquad(int time) //generic function to check all kinds of crazy gamemode specific things void checkgame(int time) { - + /* //allow faster movements when editing if (editmode) { @@ -249,7 +249,7 @@ void checkgame(int time) if(player1->hasarmour) player1->maxspeed = 14; else player1->maxspeed = 16; - + */ //force to a team if team mode @@ -564,3 +564,10 @@ void suicide() }; COMMAND(suicide, ARG_NONE); + +void FOSS( ) +{ + conoutf("Free & Open Source Software owns!"); + player1->maxspeed = 35; +}; +COMMAND( FOSS, ARG_NONE ); diff --git a/source/src/physics.cpp b/source/src/physics.cpp index aedd7db3..43a036c0 100644 --- a/source/src/physics.cpp +++ b/source/src/physics.cpp @@ -4,7 +4,7 @@ // very robust (uses discrete steps at fixed fps). #include "cube.h" - +/* bool plcollide(dynent *d, dynent *o, float &headspace) // collide with player or monster { if(o->state!=CS_ALIVE) return true; @@ -18,6 +18,24 @@ bool plcollide(dynent *d, dynent *o, float &headspace) // collide with }; return true; }; +*/ + +bool plcollide(dynent *d, dynent *o, float &headspace, float &hi, float &lo) // collide with player or monster +{ + if(o->state!=CS_ALIVE) return true; + const float r = o->radius+d->radius; + if(fabs(o->o.x-d->o.x)o.y-d->o.y)o.z-d->eyeheighto.z-o->eyeheight) { if(o->o.z-o->eyeheighto.z-o->eyeheight-1; } + else if(o->o.z+o->aboveeye>lo) lo = o->o.z+o->aboveeye+1; + + if(fabs(o->o.z-d->o.z)aboveeye+d->eyeheight) return false; + if(d->monsterstate) return false; // hack + headspace = d->o.z-o->o.z-o->aboveeye-d->eyeheight; + if(headspace<0) headspace = 10; + }; + return true; +}; bool cornertest(int mip, int x, int y, int dx, int dy, int &bx, int &by, int &bs) // recursively collide with a mipmapped corner cube { @@ -114,9 +132,9 @@ bool collide(dynent *d, bool spawn, float drop, float rise) { dynent *o = players[i]; if(!o || o==d) continue; - if(!plcollide(d, o, headspace)) return false; + if(!plcollide(d, o, headspace, hi, lo)) return false; }; - if(d!=player1) if(!plcollide(d, player1, headspace)) return false; + if(d!=player1) if(!plcollide(d, player1, headspace, hi, lo)) return false; headspace -= 0.01f; mmcollide(d, hi, lo); // collide with map models