*** empty log message ***

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@19 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
driAn
2005-06-26 19:42:18 +00:00
parent 65f6a0ea40
commit 74a817059b
2 changed files with 30 additions and 5 deletions
+9 -2
View File
@@ -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 );
+21 -3
View File
@@ -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)<r && fabs(o->o.y-d->o.y)<r)
{
if(d->o.z-d->eyeheight<o->o.z-o->eyeheight) { if(o->o.z-o->eyeheight<hi) hi = o->o.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)<o->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