From 1292c9a8f30d827d853e6aa6574a5c468820adf7 Mon Sep 17 00:00:00 2001 From: Richard Allen Date: Thu, 4 Oct 2012 15:49:55 +0000 Subject: [PATCH] IOQ3 commit 2294 --- reaction/code/botlib/be_ai_move.c | 14 ++++++-------- reaction/code/botlib/be_interface.c | 2 +- reaction/code/cgame/cg_players.c | 2 +- reaction/code/cgame/cg_servercmds.c | 3 ++- reaction/code/game/g_client.c | 10 +++++++++- reaction/code/game/g_cmds.c | 2 +- reaction/code/game/g_main.c | 4 ++-- 7 files changed, 22 insertions(+), 15 deletions(-) diff --git a/reaction/code/botlib/be_ai_move.c b/reaction/code/botlib/be_ai_move.c index 831e5f8f..c808dbc6 100644 --- a/reaction/code/botlib/be_ai_move.c +++ b/reaction/code/botlib/be_ai_move.c @@ -742,7 +742,7 @@ void BotAddAvoidSpot(int movestate, vec3_t origin, float radius, int type) int BotGetReachabilityToGoal(vec3_t origin, int areanum, int lastgoalareanum, int lastareanum, int *avoidreach, float *avoidreachtimes, int *avoidreachtries, - bot_goal_t *goal, int travelflags, int movetravelflags, + bot_goal_t *goal, int travelflags, struct bot_avoidspot_s *avoidspots, int numavoidspots, int *flags) { int i, t, besttime, bestreachnum, reachnum; @@ -754,7 +754,6 @@ int BotGetReachabilityToGoal(vec3_t origin, int areanum, if (AAS_AreaDoNotEnter(areanum) || AAS_AreaDoNotEnter(goal->areanum)) { travelflags |= TFL_DONOTENTER; - movetravelflags |= TFL_DONOTENTER; } //end if //use the routing to find the next area to go to besttime = 0; @@ -787,7 +786,7 @@ int BotGetReachabilityToGoal(vec3_t origin, int areanum, if (lastgoalareanum == goal->areanum && reach.areanum == lastareanum) continue; //if (AAS_AreaContentsTravelFlags(reach.areanum) & ~travelflags) continue; //if the travel isn't valid - if (!BotValidTravel(origin, &reach, movetravelflags)) continue; + if (!BotValidTravel(origin, &reach, travelflags)) continue; //get the travel time t = AAS_AreaTravelTimeToGoalArea(reach.areanum, reach.end, goal->areanum, travelflags); //if the goal area isn't reachable from the reachable area @@ -874,7 +873,7 @@ int BotMovementViewTarget(int movestate, bot_goal_t *goal, int travelflags, floa reachnum = BotGetReachabilityToGoal(reach.end, reach.areanum, ms->lastgoalareanum, lastareanum, ms->avoidreach, ms->avoidreachtimes, ms->avoidreachtries, - goal, travelflags, travelflags, NULL, 0, NULL); + goal, travelflags, NULL, 0, NULL); VectorCopy(reach.end, end); lastareanum = reach.areanum; if (lastareanum == goal->areanum) @@ -933,7 +932,7 @@ int BotPredictVisiblePosition(vec3_t origin, int areanum, bot_goal_t *goal, int reachnum = BotGetReachabilityToGoal(end, areanum, lastgoalareanum, lastareanum, avoidreach, avoidreachtimes, avoidreachtries, - goal, travelflags, travelflags, NULL, 0, NULL); + goal, travelflags, NULL, 0, NULL); if (!reachnum) return qfalse; AAS_ReachabilityFromNum(reachnum, &reach); // @@ -3246,7 +3245,7 @@ void BotMoveToGoal(bot_moveresult_t *result, int movestate, bot_goal_t *goal, in reachnum = BotGetReachabilityToGoal(ms->origin, ms->areanum, ms->lastgoalareanum, ms->lastareanum, ms->avoidreach, ms->avoidreachtimes, ms->avoidreachtries, - goal, travelflags, travelflags, + goal, travelflags, ms->avoidspots, ms->numavoidspots, &resultflags); //the area number the reachability starts in ms->reachareanum = ms->areanum; @@ -3369,7 +3368,7 @@ void BotMoveToGoal(bot_moveresult_t *result, int movestate, bot_goal_t *goal, in lastreachnum = BotGetReachabilityToGoal(end, areas[i], ms->lastgoalareanum, ms->lastareanum, ms->avoidreach, ms->avoidreachtimes, ms->avoidreachtries, - goal, travelflags, TFL_JUMPPAD, ms->avoidspots, ms->numavoidspots, NULL); + goal, TFL_JUMPPAD, ms->avoidspots, ms->numavoidspots, NULL); if (lastreachnum) { ms->lastreachnum = lastreachnum; @@ -3389,7 +3388,6 @@ void BotMoveToGoal(bot_moveresult_t *result, int movestate, bot_goal_t *goal, in ms->lastreachnum = lastreachnum; ms->lastareanum = areas[i]; //botimport.Print(PRT_MESSAGE, "found jumppad reachability hard!!\n"); - break; } //end if } //end for if (lastreachnum) break; diff --git a/reaction/code/botlib/be_interface.c b/reaction/code/botlib/be_interface.c index 4c982082..394a7643 100644 --- a/reaction/code/botlib/be_interface.c +++ b/reaction/code/botlib/be_interface.c @@ -323,7 +323,7 @@ void ElevatorBottomCenter(aas_reachability_t *reach, vec3_t bottomcenter); int BotGetReachabilityToGoal(vec3_t origin, int areanum, int lastgoalareanum, int lastareanum, int *avoidreach, float *avoidreachtimes, int *avoidreachtries, - bot_goal_t *goal, int travelflags, int movetravelflags, + bot_goal_t *goal, int travelflags, struct bot_avoidspot_s *avoidspots, int numavoidspots, int *flags); int AAS_PointLight(vec3_t origin, int *red, int *green, int *blue); diff --git a/reaction/code/cgame/cg_players.c b/reaction/code/cgame/cg_players.c index ab416b39..bff4687a 100644 --- a/reaction/code/cgame/cg_players.c +++ b/reaction/code/cgame/cg_players.c @@ -2757,7 +2757,7 @@ void CG_ResetPlayerEntity(centity_t * cent) cent->pe.legs.pitchAngle = 0; cent->pe.legs.pitching = qfalse; - memset(¢->pe.torso, 0, sizeof(cent->pe.legs)); + memset(¢->pe.torso, 0, sizeof(cent->pe.torso)); cent->pe.torso.yawAngle = cent->rawAngles[YAW]; cent->pe.torso.yawing = qfalse; cent->pe.torso.pitchAngle = cent->rawAngles[PITCH]; diff --git a/reaction/code/cgame/cg_servercmds.c b/reaction/code/cgame/cg_servercmds.c index 621ac0c1..be790305 100644 --- a/reaction/code/cgame/cg_servercmds.c +++ b/reaction/code/cgame/cg_servercmds.c @@ -797,7 +797,8 @@ static void CG_MapRestart(void) cg.fraglimitWarnings = 0; cg.timelimitWarnings = 0; - + cg.rewardTime = 0; + cg.rewardStack = 0; cg.intermissionStarted = qfalse; cg.levelShot = qfalse; diff --git a/reaction/code/game/g_client.c b/reaction/code/game/g_client.c index e5347583..a88ffcd6 100644 --- a/reaction/code/game/g_client.c +++ b/reaction/code/game/g_client.c @@ -1008,6 +1008,8 @@ void ClientUserinfoChanged(int clientNum) // check for malformed or illegal info strings if (!Info_Validate(userinfo)) { strcpy(userinfo, "\\name\\badinfo"); + // don't keep those clients and userinfo + trap_DropClient(clientNum, "Invalid userinfo"); } // check for local client s = Info_ValueForKey(userinfo, "ip"); @@ -1320,6 +1322,12 @@ char *ClientConnect(int clientNum, qboolean firstTime, qboolean isBot) return "Invalid password"; } } + // if a player reconnects quickly after a disconnect, the client disconnect may never be called, thus flag can get lost in the ether + if (ent->inuse) { + G_LogPrintf("Forcing disconnect on active client: %i\n", ent-g_entities); + // so lets just fix up anything that should happen on a disconnect + ClientDisconnect(ent-g_entities); + } // they can connect ent->client = level.clients + clientNum; client = ent->client; @@ -1971,7 +1979,7 @@ void ClientDisconnect(int clientNum) G_RemoveQueuedBotBegin(clientNum); ent = g_entities + clientNum; - if (!ent->client) { + if (!ent->client || ent->client->pers.connected == CON_DISCONNECTED) { return; } // JBravo: to keep the ui teamcount cvars right. diff --git a/reaction/code/game/g_cmds.c b/reaction/code/game/g_cmds.c index 19b4c5da..81438eee 100644 --- a/reaction/code/game/g_cmds.c +++ b/reaction/code/game/g_cmds.c @@ -3000,7 +3000,7 @@ void ClientCommand(int clientNum) char cmd[MAX_TOKEN_CHARS]; ent = g_entities + clientNum; - if (!ent->client) { + if (!ent->client || ent->client->pers.connected != CON_CONNECTED) { return; // not fully in game yet } diff --git a/reaction/code/game/g_main.c b/reaction/code/game/g_main.c index 71886935..7f03de62 100644 --- a/reaction/code/game/g_main.c +++ b/reaction/code/game/g_main.c @@ -2322,9 +2322,9 @@ void CheckExitRules(void) } } - if (level.numPlayingClients < 2) { +/* if (level.numPlayingClients < 2) { return; - } + } */ if (g_gametype.integer < GT_CTF && g_fraglimit.integer) { if (level.teamScores[TEAM_RED] >= g_fraglimit.integer) {