*** empty log message ***
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1187 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
@@ -26,8 +26,6 @@ void CACBot::Spawn()
|
||||
// Init all bot variabeles
|
||||
m_pMyEnt->nextprimary = 2 + rnd(4);
|
||||
m_pMyEnt->targetyaw = m_pMyEnt->targetpitch = 0.0f;
|
||||
equip(m_pMyEnt);
|
||||
m_pMyEnt->armour = 0;
|
||||
m_pMyEnt->pBot = this;
|
||||
|
||||
spawnplayer(m_pMyEnt);
|
||||
|
||||
@@ -128,8 +128,11 @@ void deathstate(playerent *pl)
|
||||
pl->pitch = 0;
|
||||
pl->roll = 60;
|
||||
pl->strafe = 0;
|
||||
dblend = 0;
|
||||
if(pl == player1 && pl->inhandnade) thrownade(pl, vec(0,0,0), pl->inhandnade);
|
||||
if(pl == player1)
|
||||
{
|
||||
dblend = 0;
|
||||
if(pl->inhandnade) thrownade(pl, vec(0,0,0), pl->inhandnade);
|
||||
}
|
||||
}
|
||||
|
||||
void spawnstate(playerent *d) // reset player state not persistent accross spawns
|
||||
@@ -316,7 +319,7 @@ void updateworld(int curtime, int lastmillis) // main game update loop
|
||||
int spawncycle = -1;
|
||||
int fixspawn = 2;
|
||||
|
||||
// returns -2 for a free place, else dist to the nearest enemy
|
||||
// returns -1 for a free place, else dist to the nearest enemy
|
||||
float nearestenemy(vec place, char *team)
|
||||
{
|
||||
float nearestenemydist = -1;
|
||||
@@ -327,7 +330,7 @@ float nearestenemy(vec place, char *team)
|
||||
float dist = place.dist(other->o);
|
||||
if(dist < nearestenemydist || nearestenemydist == -1) nearestenemydist = dist;
|
||||
}
|
||||
if(nearestenemydist >= SECURESPAWNDIST || nearestenemydist == -1) return -2;
|
||||
if(nearestenemydist >= SECURESPAWNDIST || nearestenemydist < 0) return -1;
|
||||
else return nearestenemydist;
|
||||
}
|
||||
|
||||
@@ -347,7 +350,7 @@ int findplayerstart(playerent *d)
|
||||
spawncycle = findentity(PLAYERSTART, spawncycle+1);
|
||||
if(spawncycle < 0 || spawncycle >= ents.length()) continue;
|
||||
float dist = nearestenemy(vec(ents[spawncycle].x, ents[spawncycle].y, ents[spawncycle].z), d->team);
|
||||
if(dist == -2 || (bestdist != -2 && dist > bestdist) || bestent == -1) { bestent = spawncycle; bestdist = dist; }
|
||||
if(bestent < 0 || dist < 0 || (bestdist >= 0 && dist > bestdist)) { bestent = spawncycle; bestdist = dist; }
|
||||
}
|
||||
|
||||
return bestent;
|
||||
|
||||
@@ -78,8 +78,6 @@ itemstat itemstats[] =
|
||||
{16, 0, 72, S_ITEMPUP}, //powerup
|
||||
};
|
||||
|
||||
void baseammo(int gun, playerent *d) { d->ammo[gun] = itemstats[gun].add*2; }
|
||||
|
||||
// these two functions are called when the server acknowledges that you really
|
||||
// picked up the item (in multiplayer someone may grab it before you).
|
||||
|
||||
@@ -105,7 +103,7 @@ void realpickup(int n, playerent *d)
|
||||
break;
|
||||
case I_GRENADE:
|
||||
equipitem(d, n, d->mag[6], 6);
|
||||
player1->thrownademillis = 0;
|
||||
d->thrownademillis = 0;
|
||||
break;
|
||||
case I_HEALTH:
|
||||
equipitem(d, n, d->health, 7);
|
||||
|
||||
@@ -347,7 +347,6 @@ extern void realpickup(int n, playerent *d);
|
||||
extern void renderentities();
|
||||
extern void resetspawns();
|
||||
extern void setspawn(int i, bool on);
|
||||
extern void baseammo(int gun, playerent *d);
|
||||
extern void checkitems(playerent *d);
|
||||
extern void equip(playerent *d);
|
||||
extern bool intersect(entity *e, vec &from, vec &to, vec *end=NULL);
|
||||
|
||||
Reference in New Issue
Block a user