From: Rene S. <sa...@us...> - 2005-02-06 18:59:00
|
Update of /cvsroot/jake2/jake2/src/jake2/game In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14932/src/jake2/game Modified Files: GameAI.java Log Message: eliminated ScoreBoard functions (are in PlayerHud.java). Index: GameAI.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameAI.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** GameAI.java 22 Sep 2004 19:22:06 -0000 1.5 --- GameAI.java 6 Feb 2005 18:58:51 -0000 1.6 *************** *** 26,29 **** --- 26,30 ---- import jake2.Globals; import jake2.client.M; + import jake2.game.monsters.M_Player; import jake2.qcommon.Com; import jake2.server.SV_WORLD; *************** *** 1357,1361 **** boolean ff; ! if (GameBase.coop.value != 0 && attacker.client != null) GameBase.meansOfDeath |= Defines.MOD_FRIENDLY_FIRE; --- 1358,1363 ---- boolean ff; ! // attacker can be null by some mods! bug fix by rene stoeckel ! if (GameBase.coop.value != 0 && attacker != null && attacker.client != null) GameBase.meansOfDeath |= Defines.MOD_FRIENDLY_FIRE; *************** *** 1543,1656 **** } ! /* ! * ================== DeathmatchScoreboardMessage ! * ! * ================== ! */ ! public static void DeathmatchScoreboardMessage(edict_t ent, edict_t killer) { ! String entry; ! String string; ! int stringlength; ! int i, j, k; ! int sorted[] = new int[Defines.MAX_CLIENTS]; ! int sortedscores[] = new int[Defines.MAX_CLIENTS]; ! int score, total; ! int picnum; ! int x, y; ! gclient_t cl; ! edict_t cl_ent; ! String tag; ! ! // sort the clients by score ! total = 0; ! for (i = 0; i < GameBase.game.maxclients; i++) { ! cl_ent = GameBase.g_edicts[1 + i]; ! if (!cl_ent.inuse || GameBase.game.clients[i].resp.spectator) ! continue; ! score = GameBase.game.clients[i].resp.score; ! for (j = 0; j < total; j++) { ! if (score > sortedscores[j]) ! break; ! } ! for (k = total; k > j; k--) { ! sorted[k] = sorted[k - 1]; ! sortedscores[k] = sortedscores[k - 1]; ! } ! sorted[j] = i; ! sortedscores[j] = score; ! total++; ! } ! ! // print level name and exit rules ! string = ""; ! ! stringlength = string.length(); ! ! // add the clients in sorted order ! if (total > 12) ! total = 12; ! ! for (i = 0; i < total; i++) { ! cl = GameBase.game.clients[sorted[i]]; ! cl_ent = GameBase.g_edicts[1 + sorted[i]]; ! ! picnum = GameBase.gi.imageindex("i_fixme"); ! x = (i >= 6) ? 160 : 0; ! y = 32 + 32 * (i % 6); ! ! // add a dogtag ! if (cl_ent == ent) ! tag = "tag1"; ! else if (cl_ent == killer) ! tag = "tag2"; ! else ! tag = null; ! if (tag != null) { ! entry = "xv " + (x + 32) + " yv " + y + " picn " + tag + " "; ! j = entry.length(); ! if (stringlength + j > 1024) ! break; ! ! string = string + entry; ! ! //was: strcpy (string + stringlength, entry); ! stringlength += j; ! } ! ! // send the layout ! entry = "client " + x + " " + y + " " + sorted[i] + " " ! + cl.resp.score + " " + cl.ping + " " ! + (GameBase.level.framenum - cl.resp.enterframe) / 600f ! + " "; ! ! j = entry.length(); ! ! if (stringlength + j > 1024) ! break; ! ! string += entry; ! // was: strcpy(string + stringlength, entry); ! stringlength += j; ! } ! ! GameBase.gi.WriteByte(Defines.svc_layout); ! GameBase.gi.WriteString(string); ! } ! ! /* ! * ================== DeathmatchScoreboard ! * ! * Draw instead of help message. Note that it isn't that hard to overflow ! * the 1400 byte message limit! ================== ! */ ! public static void DeathmatchScoreboard(edict_t ent) { ! DeathmatchScoreboardMessage(ent, ent.enemy); ! GameBase.gi.unicast(ent, true); ! } ! ! /* ! * ================== HelpComputer ! * ! * Draw help computer. ================== */ public static void HelpComputer(edict_t ent) { --- 1545,1550 ---- } ! /** ! * HelpComputer. Draws the help computer. */ public static void HelpComputer(edict_t ent) { *************** *** 3438,3441 **** } }; ! ! } \ No newline at end of file --- 3332,3334 ---- } }; ! } |