diff --git a/source/src/client.cpp b/source/src/client.cpp index 47e0db15..240cb970 100644 --- a/source/src/client.cpp +++ b/source/src/client.cpp @@ -46,8 +46,8 @@ void ctf_team(char *name) if(strcmp(name, player1->team) == 0 && isvalidteam) return; c2sinit = false; ctf_death(); - if(isvalidteam) strcpy_s(player1->team, name); - else strcpy_s(player1->team, rb_team_string(rnd(2))); + if(isvalidteam) strcpy(player1->team, name); + else strcpy(player1->team, rb_team_string(rnd(2))); player1->lastaction = lastmillis; player1->state = CS_DEAD; }; diff --git a/source/src/clientextras.cpp b/source/src/clientextras.cpp index 34166223..44e6848a 100644 --- a/source/src/clientextras.cpp +++ b/source/src/clientextras.cpp @@ -17,7 +17,7 @@ void renderclient(dynent *d, bool team, char *mdlname, bool vwep, float scale) int basetime = -((int)d&0xFFF); if(d->state==CS_DEAD) { - d->pitch = 180.0f; + d->pitch = 0.1f; //if(vwep) mz = S((int)d->o.x, (int)d->o.y)->floor; int r; n = (int)d%3; r = range[n]; @@ -77,7 +77,7 @@ void renderclients() renderplayer(d); }; - if(player1->state==CS_DEAD) renderplayer(d); + if(player1->state==CS_DEAD) renderplayer(player1); }; void spawn_dummy() diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index 726aa7f4..2a61035c 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -321,7 +321,7 @@ int nearestenemy(vec *v, string team) { dynent *other = players[i]; if(!other) continue; - if(m_teammode && isteam(team,other->team))continue; // its a teammate + if(isteam(team,other->team))continue; // its a teammate vec place = {v->x, v->y, v->z}; vdistsquared(distsquared, t, place, other->o); if(nearestPlayerDistSquared == -1) nearestPlayerDistSquared = distsquared; // first run @@ -338,13 +338,13 @@ void spawnplayer(dynent *d, bool secure) // place at random spawn { loopj(10) // EDIT: AH { - int r = fixspawn-->0 ? 4 : rnd(10)+1; - loopi(r) spawncycle = findplayerstart(rb_team_int(d->team), spawncycle+1, m_teammode); + int r = fixspawn-->0 ? 4 : rnd(10)+1; + loopi(r) spawncycle = findplayerstart(m_teammode ? rb_team_int(d->team) : 100, spawncycle+1); if(spawncycle!=-1 && secure) { entity &e = ents[spawncycle]; vec pos = { e.x, e.y, e.z }; - if(m_teammode && nearestenemy(&pos, d->team) == -1) break; + if(nearestenemy(&pos, d->team) == -1) break; } else break; }; if(spawncycle!=-1) @@ -516,7 +516,7 @@ void preparectf(bool cleanonly=false) if(e.type==CTF_FLAG) { e.spawned = true; - if(e.attr2<0||e.attr2>2) { conoutf("invalid ctf-flag entity (%i)", i); e.attr2 = 0; }; + if(e.attr2>2) { conoutf("invalid ctf-flag entity (%i)", i); e.attr2 = 0; }; flaginfo &f = flaginfos[e.attr2]; f.flag = &e; f.state = CTFF_INBASE; diff --git a/source/src/protos.h b/source/src/protos.h index 6b8355b7..fb4353a5 100644 --- a/source/src/protos.h +++ b/source/src/protos.h @@ -111,7 +111,7 @@ extern void remip(block &b, int level = 0); extern void remipmore(block &b, int level = 0); extern int closestent(); extern int findentity(int type, int index = 0); -extern int findplayerstart(int team, int index, bool checkteam); +extern int findplayerstart(int team, int index); extern void trigger(int tag, int type, bool savegame); extern void resettagareas(); extern void settagareas(); diff --git a/source/src/world.cpp b/source/src/world.cpp index 36dc7ca1..d76519ed 100644 --- a/source/src/world.cpp +++ b/source/src/world.cpp @@ -294,10 +294,10 @@ int findentity(int type, int index) return -1; }; -int findplayerstart(int team, int index, bool checkteam) +int findplayerstart(int team, int index) { - for(int i = index; ipitch); + float apitch = (float)fabs(player1->state==CS_DEAD ? -90.0f : player1->pitch); float af = getvar("fov")/2+apitch/1.5f+3; float byaw = (player1->yaw-90+af)/360*PI2; float syaw = (player1->yaw-90-af)/360*PI2;