diff --git a/source/src/bot/ac_bot.cpp b/source/src/bot/ac_bot.cpp index d824deaf..155ee8d3 100644 --- a/source/src/bot/ac_bot.cpp +++ b/source/src/bot/ac_bot.cpp @@ -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); diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index 52f965f3..121972e6 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -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; diff --git a/source/src/entities.cpp b/source/src/entities.cpp index 48dc5d33..95cf13b7 100644 --- a/source/src/entities.cpp +++ b/source/src/entities.cpp @@ -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); diff --git a/source/src/protos.h b/source/src/protos.h index cf765525..c352fb6c 100644 --- a/source/src/protos.h +++ b/source/src/protos.h @@ -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);