From: Rene S. <sa...@us...> - 2005-12-27 21:02:42
|
Update of /cvsroot/jake2/jake2/src/jake2/game In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7724/src/jake2/game Modified Files: PlayerView.java PlayerClient.java GameAI.java GameUtil.java Info.java Log Message: code cleanups and beautification Index: PlayerView.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/PlayerView.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PlayerView.java 16 Nov 2005 22:24:52 -0000 1.4 --- PlayerView.java 27 Dec 2005 21:02:30 -0000 1.5 *************** *** 41,49 **** public static float[] up = { 0, 0, 0 }; ! /* ! * =============== ! * SV_CalcRoll ! * ! * =============== */ public static float SV_CalcRoll(float[] angles, float[] velocity) { --- 41,46 ---- public static float[] up = { 0, 0, 0 }; ! /** ! * SV_CalcRoll. */ public static float SV_CalcRoll(float[] angles, float[] velocity) { *************** *** 213,228 **** } ! /* ! * =============== ! * SV_CalcViewOffset ! * ! * Auto pitching on slopes? ! * ! * fall from 128: 400 = 160000 fall from 256: 580 = 336400 fall from 384: ! * 720 = 518400 fall from 512: 800 = 640000 fall from 640: 960 = * * damage = deltavelocity*deltavelocity * 0.0001 - * - * =============== */ public static void SV_CalcViewOffset(edict_t ent) { --- 210,221 ---- } ! /** * + * fall from 128: 400 = 160000 + * fall from 256: 580 = 336400 + * fall from 384: 720 = 518400 + * fall from 512: 800 = 640000 + * fall from 640: 960 = * damage = deltavelocity*deltavelocity * 0.0001 */ public static void SV_CalcViewOffset(edict_t ent) { *************** *** 233,238 **** float[] v = { 0, 0, 0 }; - //=================================== - // base angles angles = ent.client.ps.kick_angles; --- 226,229 ---- *************** *** 246,255 **** ent.client.ps.viewangles[Defines.YAW] = ent.client.killer_yaw; } else { // add angles based on weapon kick - Math3D.VectorCopy(ent.client.kick_angles, angles); // add angles based on damage kick - ratio = (ent.client.v_dmg_time - GameBase.level.time) / Defines.DAMAGE_TIME; --- 237,245 ---- ent.client.ps.viewangles[Defines.YAW] = ent.client.killer_yaw; } else { + // add angles based on weapon kick Math3D.VectorCopy(ent.client.kick_angles, angles); // add angles based on damage kick ratio = (ent.client.v_dmg_time - GameBase.level.time) / Defines.DAMAGE_TIME; *************** *** 263,267 **** // add pitch based on fall kick - ratio = (ent.client.fall_time - GameBase.level.time) / Defines.FALL_TIME; --- 253,256 ---- *************** *** 271,275 **** // add angles based on velocity - delta = Math3D.DotProduct(ent.velocity, forward); angles[Defines.PITCH] += delta * GameBase.run_pitch.value; --- 260,263 ---- *************** *** 279,283 **** // add angles based on bob - delta = bobfracsin * GameBase.bob_pitch.value * xyspeed; if ((ent.client.ps.pmove.pm_flags & pmove_t.PMF_DUCKED) != 0) --- 267,270 ---- *************** *** 292,307 **** } - //=================================== - // base origin - Math3D.VectorClear(v); // add view height - v[2] += ent.viewheight; // add fall height - ratio = (ent.client.fall_time - GameBase.level.time) / Defines.FALL_TIME; --- 279,289 ---- *************** *** 311,318 **** // add bob height - bob = bobfracsin * xyspeed * GameBase.bob_up.value; if (bob > 6) bob = 6; //gi.DebugGraph (bob *2, 255); v[2] += bob; --- 293,300 ---- // add bob height bob = bobfracsin * xyspeed * GameBase.bob_up.value; if (bob > 6) bob = 6; + //gi.DebugGraph (bob *2, 255); v[2] += bob; *************** *** 341,348 **** } ! /* ! * ============== ! * SV_CalcGunOffset ! * ============== */ public static void SV_CalcGunOffset(edict_t ent) { --- 323,328 ---- } ! /** ! * Calculates where to draw the gun. */ public static void SV_CalcGunOffset(edict_t ent) { *************** *** 388,395 **** } ! /* ! * ============= ! * SV_AddBlend ! * ============= */ public static void SV_AddBlend(float r, float g, float b, float a, --- 368,373 ---- } ! /** ! * Adds a blending effect to the clients view. */ public static void SV_AddBlend(float r, float g, float b, float a, *************** *** 408,415 **** } ! /* ! * ============= ! * SV_CalcBlend ! * ============= */ public static void SV_CalcBlend(edict_t ent) { --- 386,391 ---- } ! /** ! * Calculates the blending color according to the players environment. */ public static void SV_CalcBlend(edict_t ent) { *************** *** 439,454 **** remaining = (int) (ent.client.quad_framenum - GameBase.level.framenum); if (remaining == 30) // beginning to fade ! GameBase.gi.sound(ent, Defines.CHAN_ITEM, GameBase.gi ! .soundindex("items/damage2.wav"), 1, Defines.ATTN_NORM, ! 0); if (remaining > 30 || (remaining & 4) != 0) SV_AddBlend(0, 0, 1, 0.08f, ent.client.ps.blend); } else if (ent.client.invincible_framenum > GameBase.level.framenum) { ! remaining = (int) ent.client.invincible_framenum ! - GameBase.level.framenum; if (remaining == 30) // beginning to fade ! GameBase.gi.sound(ent, Defines.CHAN_ITEM, GameBase.gi ! .soundindex("items/protect2.wav"), 1, ! Defines.ATTN_NORM, 0); if (remaining > 30 || (remaining & 4) != 0) SV_AddBlend(1, 1, 0, 0.08f, ent.client.ps.blend); --- 415,427 ---- remaining = (int) (ent.client.quad_framenum - GameBase.level.framenum); if (remaining == 30) // beginning to fade ! GameBase.gi.sound(ent, Defines.CHAN_ITEM, ! GameBase.gi.soundindex("items/damage2.wav"), 1, Defines.ATTN_NORM, 0); if (remaining > 30 || (remaining & 4) != 0) SV_AddBlend(0, 0, 1, 0.08f, ent.client.ps.blend); } else if (ent.client.invincible_framenum > GameBase.level.framenum) { ! remaining = (int) ent.client.invincible_framenum - GameBase.level.framenum; if (remaining == 30) // beginning to fade ! GameBase.gi.sound(ent, Defines.CHAN_ITEM, ! GameBase.gi.soundindex("items/protect2.wav"), 1, Defines.ATTN_NORM, 0); if (remaining > 30 || (remaining & 4) != 0) SV_AddBlend(1, 1, 0, 0.08f, ent.client.ps.blend); *************** *** 457,463 **** - GameBase.level.framenum; if (remaining == 30) // beginning to fade ! GameBase.gi.sound(ent, Defines.CHAN_ITEM, GameBase.gi ! .soundindex("items/airout.wav"), 1, Defines.ATTN_NORM, ! 0); if (remaining > 30 || (remaining & 4) != 0) SV_AddBlend(0, 1, 0, 0.08f, ent.client.ps.blend); --- 430,435 ---- - GameBase.level.framenum; if (remaining == 30) // beginning to fade ! GameBase.gi.sound(ent, Defines.CHAN_ITEM, ! GameBase.gi.soundindex("items/airout.wav"), 1, Defines.ATTN_NORM, 0); if (remaining > 30 || (remaining & 4) != 0) SV_AddBlend(0, 1, 0, 0.08f, ent.client.ps.blend); *************** *** 494,501 **** } ! /* ! * ================= ! * P_FallingDamage ! * ================= */ public static void P_FallingDamage(edict_t ent) { --- 466,471 ---- } ! /** ! * Calculates damage and effect when a player falls down. */ public static void P_FallingDamage(edict_t ent) { *************** *** 567,574 **** } ! /* ! * ============= ! * P_WorldEffects ! * ============= */ public static void P_WorldEffects() { --- 537,542 ---- } ! /** ! * General effect handling for a player. */ public static void P_WorldEffects() { *************** *** 951,961 **** } ! /* ! * ================= ! * ClientEndServerFrame ! * * Called for each player at the end of the server frame and right after ! * spawning ! * ================= */ public static void ClientEndServerFrame(edict_t ent) { --- 919,926 ---- } ! ! /** * Called for each player at the end of the server frame and right after ! * spawning. */ public static void ClientEndServerFrame(edict_t ent) { Index: Info.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/Info.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Info.java 21 Oct 2004 03:32:53 -0000 1.5 --- Info.java 27 Dec 2005 21:02:31 -0000 1.6 *************** *** 20,24 **** --- 20,26 ---- // Created on 27.12.2003 by RST. + // $Id$ + package jake2.game; *************** *** 30,33 **** --- 32,38 ---- public class Info { + /** + * Returns a value for a key from an info string. + */ public static String Info_ValueForKey(String s, String key) { *************** *** 51,58 **** /** ! * TODO RST: DANGEROUS port, returns the modified userinfo string, was ! * pointer-pointer manipulation first */ ! public static String Info_SetValueForKey1(String s, String key, String value) { if (value == null || value.length() == 0) --- 56,62 ---- /** ! * Sets a value for a key in the user info string. */ ! public static String Info_SetValueForKey(String s, String key, String value) { if (value == null || value.length() == 0) *************** *** 80,84 **** } ! StringBuffer sb = new StringBuffer(Info_RemoveKey1(s, key)); if (sb.length() + 2 + key.length() + value.length() > Defines.MAX_INFO_STRING) { --- 84,88 ---- } ! StringBuffer sb = new StringBuffer(Info_RemoveKey(s, key)); if (sb.length() + 2 + key.length() + value.length() > Defines.MAX_INFO_STRING) { *************** *** 93,98 **** } ! /** TODO RST: DANGEROUS port, returns now the modified userinfo string. */ ! public static String Info_RemoveKey1(String s, String key) { StringBuffer sb = new StringBuffer(512); --- 97,104 ---- } ! /** ! * Removes a key and value from an info string. ! */ ! public static String Info_RemoveKey(String s, String key) { StringBuffer sb = new StringBuffer(512); *************** *** 120,152 **** return sb.toString(); - //some old code follows - - /* - * char * start; char pkey[512]; char value[512]; char * o; - * - * if (key.indexOf('\\')!=-1) { Com.Printf ("Can't use a key with a - * \\\n"); return s; } - * - * while () { start = s; if (* s == '\\') s++; o = pkey; while (* s != - * '\\') { if (!* s) return; o++ = * s++; } o = 0; s++; - * - * o = value; while (* s != '\\' && * s) { if (!* s) return; o++ = * - * s++; } o = 0; - * - * if (!strcmp(key, pkey)) { strcpy(start, s); // remove this part - * return; } - * - * if (!* s) return; } - */ } ! /* ! * ================== Info_Validate ! * * Some characters are illegal in info strings because they can mess up the ! * server's parsing ================== */ public static boolean Info_Validate(String s) { ! return !((s.indexOf('"') != -1) || (s.indexOf(';') != -1)); } --- 126,137 ---- return sb.toString(); } ! /** * Some characters are illegal in info strings because they can mess up the ! * server's parsing. */ public static boolean Info_Validate(String s) { ! return !((s.indexOf('"') != -1) || (s.indexOf(';') != -1) || (s.indexOf('\\') != -1)); } *************** *** 176,207 **** sb.append(fillspaces.substring(len)); } - sb.append('=').append(value1).append('\n'); } - Com.Printf(sb.toString()); - - /* - * some old code follows - * - * char * o; int l; - * - * if (* s == '\\') s++; while (* s) { o = key; while (* s && * s != - * '\\') o++ = * s++; - * - * l = o - key; if (l < 20) { memset(o, ' ', 20 - l); key[20] = 0; } - * else o = 0; Com_Printf("%s", key); - * - * if (!* s) { Com_Printf("MISSING VALUE\n"); return; } - * - * o = value; s++; while (* s && * s != '\\') o++ = * s++; o = 0; - * - * if (* s) s++; Com_Printf("%s\n", value); } - */ - } - - public static void testintern(StringBuffer in) { - in.setLength(0); - in.append("123!"); } } \ No newline at end of file --- 161,167 ---- Index: GameAI.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameAI.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** GameAI.java 20 Nov 2005 22:18:33 -0000 1.9 --- GameAI.java 27 Dec 2005 21:02:30 -0000 1.10 *************** *** 38,46 **** } ! /* ! * ============= ai_turn ! * ! * don't move, but turn towards ideal_yaw Distance is for slight position ! * adjustments needed by the animations ============= */ public static void ai_turn(edict_t self, float dist) { --- 38,43 ---- } ! /** Don't move, but turn towards ideal_yaw Distance is for slight position ! * adjustments needed by the animations. */ public static void ai_turn(edict_t self, float dist) { *************** *** 53,83 **** M.M_ChangeYaw(self); } ! ! /* ! * ! * .enemy Will be world if not currently angry at anyone. ! * ! * .movetarget The next path spot to walk toward. If .enemy, ignore ! * .movetarget. When an enemy is killed, the monster will try to return to ! * it's path. ! * ! * .hunt_time Set to time + something when the player is in sight, but ! * movement straight for him is blocked. This causes the monster to use wall ! * following code for movement direction instead of sighting on the player. ! * ! * .ideal_yaw A yaw angle of the intended direction, which will be turned ! * towards at up to 45 deg / state. If the enemy is in view and hunt_time is ! * not active, this will be the exact line towards the enemy. ! * ! * .pausetime A monster will leave it's stand state and head towards it's ! * .movetarget when time > .pausetime. ! * ! * walkmove(angle, speed) primitive is all or nothing ! */ ! ! /* ! * ============ FacingIdeal ! * ! * ============ */ --- 50,56 ---- M.M_ChangeYaw(self); } ! ! /** ! * Checks, if the monster should turn left/right. */ *************** *** 91,99 **** } ! /* ! * ============= ai_run_melee ! * ! * Turn and close until within an angle to launch a melee attack ! * ============= */ public static void ai_run_melee(edict_t self) { --- 64,69 ---- } ! /** ! * Turn and close until within an angle to launch a melee attack. */ public static void ai_run_melee(edict_t self) { *************** *** 107,115 **** } ! /* ! * ============= ai_run_missile ! * ! * Turn in place until within an angle to launch a missile attack ! * ============= */ public static void ai_run_missile(edict_t self) { --- 77,82 ---- } ! /** ! * Turn in place until within an angle to launch a missile attack. */ public static void ai_run_missile(edict_t self) { *************** *** 123,130 **** }; ! /* ! * ============= ai_run_slide ! * ! * Strafe sideways, but stay at aproximately the same range ============= */ public static void ai_run_slide(edict_t self, float distance) { --- 90,95 ---- }; ! /** ! * Strafe sideways, but stay at aproximately the same range. */ public static void ai_run_slide(edict_t self, float distance) { *************** *** 146,154 **** } ! /* ! * ============= ai_checkattack ! * * Decides if we're going to attack or do something else used by ai_run and ! * ai_stand ============= */ public static boolean ai_checkattack(edict_t self, float dist) { --- 111,136 ---- } ! /** * Decides if we're going to attack or do something else used by ai_run and ! * ai_stand. ! * ! * .enemy Will be world if not currently angry at anyone. ! * ! * .movetarget The next path spot to walk toward. If .enemy, ignore ! * .movetarget. When an enemy is killed, the monster will try to return to ! * it's path. ! * ! * .hunt_time Set to time + something when the player is in sight, but ! * movement straight for him is blocked. This causes the monster to use wall ! * following code for movement direction instead of sighting on the player. ! * ! * .ideal_yaw A yaw angle of the intended direction, which will be turned ! * towards at up to 45 deg / state. If the enemy is in view and hunt_time is ! * not active, this will be the exact line towards the enemy. ! * ! * .pausetime A monster will leave it's stand state and head towards it's ! * .movetarget when time > .pausetime. ! * ! * walkmove(angle, speed) primitive is all or nothing */ public static boolean ai_checkattack(edict_t self, float dist) { *************** *** 157,161 **** boolean hesDeadJim; ! // this causes monsters to run blindly to the combat point w/o firing if (self.goalentity != null) { if ((self.monsterinfo.aiflags & Defines.AI_COMBAT_POINT) != 0) --- 139,143 ---- boolean hesDeadJim; ! // this causes monsters to run blindly to the combat point w/o firing if (self.goalentity != null) { if ((self.monsterinfo.aiflags & Defines.AI_COMBAT_POINT) != 0) *************** *** 181,185 **** enemy_vis = false; ! // see if the enemy is dead hesDeadJim = false; if ((null == self.enemy) || (!self.enemy.inuse)) { --- 163,167 ---- enemy_vis = false; ! // see if the enemy is dead hesDeadJim = false; if ((null == self.enemy) || (!self.enemy.inuse)) { *************** *** 224,230 **** self.show_hostile = (int) GameBase.level.time + 1; // wake up other ! // monsters ! ! // check knowledge of enemy enemy_vis = GameUtil.visible(self, self.enemy); if (enemy_vis) { --- 206,211 ---- self.show_hostile = (int) GameBase.level.time + 1; // wake up other ! ! // monsters check knowledge of enemy enemy_vis = GameUtil.visible(self, self.enemy); if (enemy_vis) { *************** *** 234,244 **** } - // look for other coop players here - // if (coop && self.monsterinfo.search_time < level.time) - // { - // if (FindTarget (self)) - // return true; - // } - enemy_infront = GameUtil.infront(self, self.enemy); enemy_range = GameUtil.range(self, self.enemy); --- 215,218 ---- *************** *** 266,270 **** /** * The monster is walking it's beat. - * */ static void ai_walk(edict_t self, float dist) { --- 240,243 ---- *************** *** 288,295 **** } ! /* ! * ================= ! * AI_SetSightClient ! * * Called once each frame to set level.sight_client to the player to be * checked for in findtarget. --- 261,265 ---- } ! /** * Called once each frame to set level.sight_client to the player to be * checked for in findtarget. *************** *** 298,302 **** * * In coop games, sight_client will cycle between the clients. - * ================= */ static void AI_SetSightClient() { --- 268,271 ---- *************** *** 328,338 **** } ! /* ! * ============= ! * ai_move ! * * Move the specified distance at current facing. This replaces the QC * functions: ai_forward, ai_back, ai_pain, and ai_painforward - * ============== */ static void ai_move(edict_t self, float dist) { --- 297,303 ---- } ! /** * Move the specified distance at current facing. This replaces the QC * functions: ai_forward, ai_back, ai_pain, and ai_painforward */ static void ai_move(edict_t self, float dist) { *************** *** 340,345 **** } ! // ============================================================================ ! //ok static void HuntTarget(edict_t self) { float[] vec = { 0, 0, 0 }; --- 305,312 ---- } ! ! /** ! * Decides running or standing according to flag AI_STAND_GROUND. ! */ static void HuntTarget(edict_t self) { float[] vec = { 0, 0, 0 }; *************** *** 352,355 **** --- 319,323 ---- Math3D.VectorSubtract(self.enemy.s.origin, self.s.origin, vec); self.ideal_yaw = Math3D.vectoyaw(vec); + // wait a while before first attack if (0 == (self.monsterinfo.aiflags & Defines.AI_STAND_GROUND)) *************** *** 357,360 **** --- 325,329 ---- } + public static EntThinkAdapter walkmonster_start_go = new EntThinkAdapter() { public String getID() { return "walkmonster_start_go"; } *************** *** 447,456 **** }; ! /* ! * ============= ai_turn ! * ! * don't move, but turn towards ideal_yaw Distance is for slight position * adjustments needed by the animations - * ============= */ public static AIAdapter ai_turn = new AIAdapter() { --- 416,423 ---- }; ! ! /** ! * Don't move, but turn towards ideal_yaw Distance is for slight position * adjustments needed by the animations */ public static AIAdapter ai_turn = new AIAdapter() { *************** *** 468,478 **** }; ! /* ! * ============= ! * ai_move ! * * Move the specified distance at current facing. This replaces the QC * functions: ai_forward, ai_back, ai_pain, and ai_painforward - * ============== */ public static AIAdapter ai_move = new AIAdapter() { --- 435,442 ---- }; ! ! /** * Move the specified distance at current facing. This replaces the QC * functions: ai_forward, ai_back, ai_pain, and ai_painforward */ public static AIAdapter ai_move = new AIAdapter() { *************** *** 483,499 **** }; ! /* ! * ============= ! * ai_walk ! * ! * The monster is walking it's beat ! * ============= */ public static AIAdapter ai_walk = new AIAdapter() { public String getID() { return "ai_walk";} public void ai(edict_t self, float dist) { - if (self.index == 312) - self.index = 312; - M.M_MoveToGoal(self, dist); --- 447,457 ---- }; ! ! /** ! * The monster is walking it's beat. */ public static AIAdapter ai_walk = new AIAdapter() { public String getID() { return "ai_walk";} public void ai(edict_t self, float dist) { M.M_MoveToGoal(self, dist); *************** *** 506,514 **** if (self.monsterinfo.idle_time != 0) { self.monsterinfo.search.think(self); ! self.monsterinfo.idle_time = GameBase.level.time + 15 ! + Globals.rnd.nextFloat() * 15; } else { ! self.monsterinfo.idle_time = GameBase.level.time ! + Globals.rnd.nextFloat() * 15; } } --- 464,470 ---- if (self.monsterinfo.idle_time != 0) { self.monsterinfo.search.think(self); ! self.monsterinfo.idle_time = GameBase.level.time + 15 + Globals.rnd.nextFloat() * 15; } else { ! self.monsterinfo.idle_time = GameBase.level.time + Globals.rnd.nextFloat() * 15; } } *************** *** 516,526 **** }; ! /* ! * ============= ! * ai_stand ! * * Used for standing around and looking for players Distance is for slight ! * position adjustments needed by the animations ! * ============== */ --- 472,479 ---- }; ! ! /** * Used for standing around and looking for players Distance is for slight ! * position adjustments needed by the animations. */ *************** *** 535,541 **** if ((self.monsterinfo.aiflags & Defines.AI_STAND_GROUND) != 0) { if (self.enemy != null) { ! Math3D ! .VectorSubtract(self.enemy.s.origin, self.s.origin, ! v); self.ideal_yaw = Math3D.vectoyaw(v); if (self.s.angles[Defines.YAW] != self.ideal_yaw --- 488,492 ---- if ((self.monsterinfo.aiflags & Defines.AI_STAND_GROUND) != 0) { if (self.enemy != null) { ! Math3D.VectorSubtract(self.enemy.s.origin, self.s.origin, v); self.ideal_yaw = Math3D.vectoyaw(v); if (self.s.angles[Defines.YAW] != self.ideal_yaw *************** *** 563,571 **** if (self.monsterinfo.idle_time != 0) { self.monsterinfo.idle.think(self); ! self.monsterinfo.idle_time = GameBase.level.time + 15 ! + Globals.rnd.nextFloat() * 15; } else { ! self.monsterinfo.idle_time = GameBase.level.time ! + Globals.rnd.nextFloat() * 15; } } --- 514,520 ---- if (self.monsterinfo.idle_time != 0) { self.monsterinfo.idle.think(self); ! self.monsterinfo.idle_time = GameBase.level.time + 15 + Globals.rnd.nextFloat() * 15; } else { ! self.monsterinfo.idle_time = GameBase.level.time + Globals.rnd.nextFloat() * 15; } } *************** *** 573,583 **** }; ! /* ! * ============= ! * ai_charge ! * * Turns towards target and advances Use this call with a distnace of 0 to ! * replace ai_face ! * ============== */ public static AIAdapter ai_charge = new AIAdapter() { --- 522,528 ---- }; ! /** * Turns towards target and advances Use this call with a distnace of 0 to ! * replace ai_face. */ public static AIAdapter ai_charge = new AIAdapter() { *************** *** 595,604 **** }; ! /* ! * ============= ! * ai_run ! * ! * The monster has an enemy it is trying to kill ! * ============= */ public static AIAdapter ai_run = new AIAdapter() { --- 540,546 ---- }; ! ! /** ! * The monster has an enemy it is trying to kill. */ public static AIAdapter ai_run = new AIAdapter() { *************** *** 623,627 **** } - // rst: monster heard a sound.... if ((self.monsterinfo.aiflags & Defines.AI_SOUND_TARGET) != 0) { Math3D.VectorSubtract(self.s.origin, self.enemy.s.origin, v); --- 565,568 ---- *************** *** 653,667 **** if (enemy_vis) { ! // if (self.aiflags & AI_LOST_SIGHT) ! // dprint("regained sight\n"); M.M_MoveToGoal(self, dist); self.monsterinfo.aiflags &= ~Defines.AI_LOST_SIGHT; ! Math3D.VectorCopy(self.enemy.s.origin, ! self.monsterinfo.last_sighting); self.monsterinfo.trail_time = GameBase.level.time; return; } ! // coop will change to another enemy if visible^ if (GameBase.coop.value != 0) { // FIXME: insane guys get mad with this, which causes crashes! --- 594,607 ---- if (enemy_vis) { ! //if (self.aiflags & AI_LOST_SIGHT) ! // dprint("regained sight\n"); M.M_MoveToGoal(self, dist); self.monsterinfo.aiflags &= ~Defines.AI_LOST_SIGHT; ! Math3D.VectorCopy(self.enemy.s.origin, self.monsterinfo.last_sighting); self.monsterinfo.trail_time = GameBase.level.time; return; } ! // coop will change to another enemy if visible if (GameBase.coop.value != 0) { // FIXME: insane guys get mad with this, which causes crashes! *************** *** 687,692 **** if (0 == (self.monsterinfo.aiflags & Defines.AI_LOST_SIGHT)) { // just lost sight of the player, decide where to go first ! // dprint("lost sight of player, last seen at "); ! // dprint(vtos(self.last_sighting)); dprint("\n"); self.monsterinfo.aiflags |= (Defines.AI_LOST_SIGHT | Defines.AI_PURSUIT_LAST_SEEN); self.monsterinfo.aiflags &= ~(Defines.AI_PURSUE_NEXT | Defines.AI_PURSUE_TEMP); --- 627,633 ---- if (0 == (self.monsterinfo.aiflags & Defines.AI_LOST_SIGHT)) { // just lost sight of the player, decide where to go first ! // dprint("lost sight of player, last seen at "); ! // dprint(vtos(self.last_sighting)); ! // dprint("\n"); self.monsterinfo.aiflags |= (Defines.AI_LOST_SIGHT | Defines.AI_PURSUIT_LAST_SEEN); self.monsterinfo.aiflags &= ~(Defines.AI_PURSUE_NEXT | Defines.AI_PURSUE_TEMP); *************** *** 696,701 **** if ((self.monsterinfo.aiflags & Defines.AI_PURSUE_NEXT) != 0) { self.monsterinfo.aiflags &= ~Defines.AI_PURSUE_NEXT; ! // dprint("reached current goal: "); dprint(vtos(self.origin)); ! // dprint(" "); dprint(vtos(self.last_sighting)); dprint(" "); // dprint(ftos(vlen(self.origin - self.last_sighting))); // dprint("\n"); --- 637,646 ---- if ((self.monsterinfo.aiflags & Defines.AI_PURSUE_NEXT) != 0) { self.monsterinfo.aiflags &= ~Defines.AI_PURSUE_NEXT; ! ! // dprint("reached current goal: "); ! // dprint(vtos(self.origin)); ! // dprint(" "); ! // dprint(vtos(self.last_sighting)); ! // dprint(" "); // dprint(ftos(vlen(self.origin - self.last_sighting))); // dprint("\n"); *************** *** 705,713 **** if ((self.monsterinfo.aiflags & Defines.AI_PURSUE_TEMP) != 0) { ! // dprint("was temp goal; retrying original\n"); self.monsterinfo.aiflags &= ~Defines.AI_PURSUE_TEMP; marker = null; ! Math3D.VectorCopy(self.monsterinfo.saved_goal, ! self.monsterinfo.last_sighting); new1 = true; } else if ((self.monsterinfo.aiflags & Defines.AI_PURSUIT_LAST_SEEN) != 0) { --- 650,657 ---- if ((self.monsterinfo.aiflags & Defines.AI_PURSUE_TEMP) != 0) { ! // dprint("was temp goal; retrying original\n"); self.monsterinfo.aiflags &= ~Defines.AI_PURSUE_TEMP; marker = null; ! Math3D.VectorCopy(self.monsterinfo.saved_goal, self.monsterinfo.last_sighting); new1 = true; } else if ((self.monsterinfo.aiflags & Defines.AI_PURSUIT_LAST_SEEN) != 0) { *************** *** 719,736 **** if (marker != null) { ! Math3D.VectorCopy(marker.s.origin, ! self.monsterinfo.last_sighting); self.monsterinfo.trail_time = marker.timestamp; self.s.angles[Defines.YAW] = self.ideal_yaw = marker.s.angles[Defines.YAW]; ! // dprint("heading is "); dprint(ftos(self.ideal_yaw)); // dprint("\n"); ! ! // debug_drawline(self.origin, self.last_sighting, 52); new1 = true; } } ! Math3D.VectorSubtract(self.s.origin, ! self.monsterinfo.last_sighting, v); d1 = Math3D.VectorLength(v); if (d1 <= dist) { --- 663,678 ---- if (marker != null) { ! Math3D.VectorCopy(marker.s.origin, self.monsterinfo.last_sighting); self.monsterinfo.trail_time = marker.timestamp; self.s.angles[Defines.YAW] = self.ideal_yaw = marker.s.angles[Defines.YAW]; ! // dprint("heading is "); ! // dprint(ftos(self.ideal_yaw)); // dprint("\n"); ! // debug_drawline(self.origin, self.last_sighting, 52); new1 = true; } } ! Math3D.VectorSubtract(self.s.origin, self.monsterinfo.last_sighting, v); d1 = Math3D.VectorLength(v); if (d1 <= dist) { *************** *** 739,747 **** } ! Math3D.VectorCopy(self.monsterinfo.last_sighting, ! self.goalentity.s.origin); if (new1) { ! // gi.dprintf("checking for course correction\n"); tr = GameBase.gi.trace(self.s.origin, self.mins, self.maxs, --- 681,688 ---- } ! Math3D.VectorCopy(self.monsterinfo.last_sighting, self.goalentity.s.origin); if (new1) { ! // gi.dprintf("checking for course correction\n"); tr = GameBase.gi.trace(self.s.origin, self.mins, self.maxs, *************** *** 749,766 **** Defines.MASK_PLAYERSOLID); if (tr.fraction < 1) { ! Math3D.VectorSubtract(self.goalentity.s.origin, ! self.s.origin, v); d1 = Math3D.VectorLength(v); center = tr.fraction; d2 = d1 * ((center + 1) / 2); ! self.s.angles[Defines.YAW] = self.ideal_yaw = Math3D ! .vectoyaw(v); ! Math3D ! .AngleVectors(self.s.angles, v_forward, v_right, ! null); Math3D.VectorSet(v, d2, -16, 0); ! Math3D.G_ProjectSource(self.s.origin, v, v_forward, ! v_right, left_target); tr = GameBase.gi.trace(self.s.origin, self.mins, self.maxs, left_target, self, Defines.MASK_PLAYERSOLID); --- 690,702 ---- Defines.MASK_PLAYERSOLID); if (tr.fraction < 1) { ! Math3D.VectorSubtract(self.goalentity.s.origin, self.s.origin, v); d1 = Math3D.VectorLength(v); center = tr.fraction; d2 = d1 * ((center + 1) / 2); ! self.s.angles[Defines.YAW] = self.ideal_yaw = Math3D.vectoyaw(v); ! Math3D.AngleVectors(self.s.angles, v_forward, v_right, null); Math3D.VectorSet(v, d2, -16, 0); ! Math3D.G_ProjectSource(self.s.origin, v, v_forward, v_right, left_target); tr = GameBase.gi.trace(self.s.origin, self.mins, self.maxs, left_target, self, Defines.MASK_PLAYERSOLID); *************** *** 780,800 **** Math3D.G_ProjectSource(self.s.origin, v, v_forward, v_right, left_target); ! // gi.dprintf("incomplete path, go part way and ! // adjust again\n"); } ! Math3D.VectorCopy(self.monsterinfo.last_sighting, ! self.monsterinfo.saved_goal); self.monsterinfo.aiflags |= Defines.AI_PURSUE_TEMP; ! Math3D ! .VectorCopy(left_target, ! self.goalentity.s.origin); ! Math3D.VectorCopy(left_target, ! self.monsterinfo.last_sighting); ! Math3D.VectorSubtract(self.goalentity.s.origin, ! self.s.origin, v); ! self.s.angles[Defines.YAW] = self.ideal_yaw = Math3D ! .vectoyaw(v); ! // gi.dprintf("adjusted left\n"); ! // debug_drawline(self.origin, self.last_sighting, 152); } else if (right >= center && right > left) { if (right < 1) { --- 716,729 ---- Math3D.G_ProjectSource(self.s.origin, v, v_forward, v_right, left_target); ! // gi.dprintf("incomplete path, go part way and adjust again\n"); } ! Math3D.VectorCopy(self.monsterinfo.last_sighting, self.monsterinfo.saved_goal); self.monsterinfo.aiflags |= Defines.AI_PURSUE_TEMP; ! Math3D.VectorCopy(left_target, self.goalentity.s.origin); ! Math3D.VectorCopy(left_target, self.monsterinfo.last_sighting); ! Math3D.VectorSubtract(self.goalentity.s.origin, self.s.origin, v); ! self.s.angles[Defines.YAW] = self.ideal_yaw = Math3D.vectoyaw(v); ! // gi.dprintf("adjusted left\n"); ! // debug_drawline(self.origin, self.last_sighting, 152); } else if (right >= center && right > left) { if (right < 1) { *************** *** 802,819 **** Math3D.G_ProjectSource(self.s.origin, v, v_forward, v_right, right_target); ! // gi.dprintf("incomplete path, go part way and ! // adjust again\n"); } ! Math3D.VectorCopy(self.monsterinfo.last_sighting, ! self.monsterinfo.saved_goal); self.monsterinfo.aiflags |= Defines.AI_PURSUE_TEMP; ! Math3D.VectorCopy(right_target, ! self.goalentity.s.origin); ! Math3D.VectorCopy(right_target, ! self.monsterinfo.last_sighting); ! Math3D.VectorSubtract(self.goalentity.s.origin, ! self.s.origin, v); ! self.s.angles[Defines.YAW] = self.ideal_yaw = Math3D ! .vectoyaw(v); // gi.dprintf("adjusted right\n"); // debug_drawline(self.origin, self.last_sighting, 152); --- 731,742 ---- Math3D.G_ProjectSource(self.s.origin, v, v_forward, v_right, right_target); ! // gi.dprintf("incomplete path, go part way and adjust again\n"); } ! Math3D.VectorCopy(self.monsterinfo.last_sighting, self.monsterinfo.saved_goal); self.monsterinfo.aiflags |= Defines.AI_PURSUE_TEMP; ! Math3D.VectorCopy(right_target, self.goalentity.s.origin); ! Math3D.VectorCopy(right_target, self.monsterinfo.last_sighting); ! Math3D.VectorSubtract(self.goalentity.s.origin, self.s.origin, v); ! self.s.angles[Defines.YAW] = self.ideal_yaw = Math3D.vectoyaw(v); // gi.dprintf("adjusted right\n"); // debug_drawline(self.origin, self.last_sighting, 152); Index: GameUtil.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameUtil.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** GameUtil.java 20 Nov 2005 22:18:33 -0000 1.14 --- GameUtil.java 27 Dec 2005 21:02:31 -0000 1.15 *************** *** 41,46 **** } ! /** ! * the global "activator" should be set to the entity that initiated the * firing. * --- 41,48 ---- } ! /** ! * Use the targets. ! * ! * The global "activator" should be set to the entity that initiated the * firing. * *************** *** 59,65 **** checkClassname(ent); ! // ! // check for a delay ! // if (ent.delay != 0) { // create a temp object to fire at a later time --- 61,65 ---- checkClassname(ent); ! // check for a delay if (ent.delay != 0) { // create a temp object to fire at a later time *************** *** 77,83 **** } ! // ! // print the message ! // if ((ent.message != null) && (activator.svflags & Defines.SVF_MONSTER) == 0) { --- 77,82 ---- } ! ! // print the message if ((ent.message != null) && (activator.svflags & Defines.SVF_MONSTER) == 0) { *************** *** 91,98 **** } - // // kill killtargets - // - EdictIterator edit = null; --- 90,94 ---- *************** *** 111,115 **** // fire targets - if (ent.target != null) { edit = null; --- 107,110 ---- *************** *** 187,197 **** //if ((ed - g_edicts) <= (maxclients.value + BODY_QUEUE_SIZE)) if (ed.index <= (GameBase.maxclients.value + Defines.BODY_QUEUE_SIZE)) { ! // gi.dprintf("tried to free special edict\n"); return; } - //memset(ed, 0, sizeof(* ed)); GameBase.g_edicts[ed.index] = new edict_t(ed.index); - //ed.clear(); ed.classname = "freed"; ed.freetime = GameBase.level.time; --- 182,190 ---- //if ((ed - g_edicts) <= (maxclients.value + BODY_QUEUE_SIZE)) if (ed.index <= (GameBase.maxclients.value + Defines.BODY_QUEUE_SIZE)) { ! // gi.dprintf("tried to free special edict\n"); return; } GameBase.g_edicts[ed.index] = new edict_t(ed.index); ed.classname = "freed"; ed.freetime = GameBase.level.time; *************** *** 209,232 **** } - public static void G_TouchSolids(edict_t ent) { - int i, num; - edict_t touch[] = new edict_t[Defines.MAX_EDICTS], hit; - - num = GameBase.gi.BoxEdicts(ent.absmin, ent.absmax, touch, - Defines.MAX_EDICTS, Defines.AREA_SOLID); - - // be careful, it is possible to have an entity in this - // list removed before we get to it (killtriggered) - for (i = 0; i < num; i++) { - hit = touch[i]; - if (!hit.inuse) - continue; - if (ent.touch != null) { - ent.touch.touch(hit, ent, GameBase.dummyplane, null); - } - if (!ent.inuse) - break; - } - } /** --- 202,205 ---- *************** *** 257,260 **** --- 230,236 ---- } + /** + * Returns true, if two edicts are on the same team. + */ public static boolean OnSameTeam(edict_t ent1, edict_t ent2) { if (0 == ((int) (GameBase.dmflags.value) & (Defines.DF_MODELTEAMS | Defines.DF_SKINTEAMS))) *************** *** 266,269 **** --- 242,249 ---- } + /** + * Returns the team string of an entity + * with respect to rteam_by_model and team_by_skin. + */ static String ClientTeam(edict_t ent) { String value; *************** *** 297,307 **** } ! /* ! * ============= range ! * ! * returns the range catagorization of an entity reletive to self 0 melee * range, will become hostile even if back is turned 1 visibility and * infront, or visibility and show hostile 2 infront and show hostile 3 only ! * triggered by damage ============= */ public static int range(edict_t self, edict_t other) { --- 277,285 ---- } ! /** ! * Returns the range catagorization of an entity reletive to self 0 melee * range, will become hostile even if back is turned 1 visibility and * infront, or visibility and show hostile 2 infront and show hostile 3 only ! * triggered by damage. */ public static int range(edict_t self, edict_t other) { *************** *** 324,331 **** } ! /* ! * ============= infront ! * ! * returns true if the entity is in front (in sight) of self ============= */ public static boolean infront(edict_t self, edict_t other) { --- 302,307 ---- } ! /** ! * Returns true if the entity is in front (in sight) of self */ public static boolean infront(edict_t self, edict_t other) { *************** *** 344,352 **** } ! /* ! * ============= visible ! * ! * returns 1 if the entity is visible to self, even if not infront () ! * ============= */ public static boolean visible(edict_t self, edict_t other) { --- 320,325 ---- } ! /** ! * Returns 1 if the entity is visible to self, even if not infront(). */ public static boolean visible(edict_t self, edict_t other) { *************** *** 367,372 **** } ! /* ! * =========== FindTarget * * Self is currently not attacking anything, so try to find a target --- 340,345 ---- } ! /** ! * Finds a target. * * Self is currently not attacking anything, so try to find a target *************** *** 380,384 **** * To avoid spending too much time, only a single client (or fakeclient) is * checked each frame. This means multi player games will have slightly ! * slower noticing monsters. ============ */ static boolean FindTarget(edict_t self) { --- 353,357 ---- * To avoid spending too much time, only a single client (or fakeclient) is * checked each frame. This means multi player games will have slightly ! * slower noticing monsters. */ static boolean FindTarget(edict_t self) { *************** *** 387,395 **** int r; ! if ((self.monsterinfo.aiflags & Defines.AI_GOOD_GUY) != 0) ! { if (self.goalentity != null && self.goalentity.inuse ! && self.goalentity.classname != null) ! { if (self.goalentity.classname.equals("target_actor")) return false; --- 360,366 ---- int r; ! if ((self.monsterinfo.aiflags & Defines.AI_GOOD_GUY) != 0) { if (self.goalentity != null && self.goalentity.inuse ! && self.goalentity.classname != null) { if (self.goalentity.classname.equals("target_actor")) return false; *************** *** 524,531 **** self.enemy = client; } ! ! // ! // got one ! // FoundTarget(self); --- 495,500 ---- self.enemy = client; } ! ! // got one FoundTarget(self); *************** *** 615,644 **** }; ! /* ! * ============= ! * range ! * ! * returns the range catagorization of an entity reletive to self. 0 melee ! * range, will become hostile even if back is turned 1 visibility and ! * infront, or visibility and show hostile 2 infront and show hostile 3 only ! * triggered by damage ! * ! */ ! // static int range(edict_t self, edict_t other) ! // { ! // float[] v= { 0, 0, 0 }; ! // float len; ! // ! // VectorSubtract(self.s.origin, other.s.origin, v); ! // len= VectorLength(v); ! // if (len < MELEE_DISTANCE) ! // return RANGE_MELEE; ! // if (len < 500) ! // return RANGE_NEAR; ! // if (len < 1000) ! // return RANGE_MID; ! // return RANGE_FAR; ! // } ! // ============================================================================ public static EntThinkAdapter M_CheckAttack = new EntThinkAdapter() { public String getID() { return "M_CheckAttack"; } --- 584,588 ---- }; ! public static EntThinkAdapter M_CheckAttack = new EntThinkAdapter() { public String getID() { return "M_CheckAttack"; } *************** *** 681,685 **** } ! // missile attack if (self.monsterinfo.attack == null) return false; --- 625,629 ---- } ! // missile attack if (self.monsterinfo.attack == null) return false; Index: PlayerClient.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/PlayerClient.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** PlayerClient.java 20 Nov 2005 22:18:33 -0000 1.11 --- PlayerClient.java 27 Dec 2005 21:02:30 -0000 1.12 *************** *** 34,41 **** public static int player_die_i = 0; ! /* ! * ================== ! * player_die ! * ================== */ static EntDieAdapter player_die = new EntDieAdapter() { --- 34,40 ---- public static int player_die_i = 0; ! ! /** ! * player_die. */ static EntDieAdapter player_die = new EntDieAdapter() { *************** *** 60,64 **** self.maxs[2] = -8; ! // self.solid = SOLID_NOT; self.svflags |= Defines.SVF_DEADMONSTER; --- 59,63 ---- self.maxs[2] = -8; ! // self.solid = SOLID_NOT; self.svflags |= Defines.SVF_DEADMONSTER; *************** *** 162,166 **** if ((self.targetname == null) || Lib.Q_stricmp(self.targetname, spot.targetname) != 0) { ! // gi.dprintf("FixCoopSpots changed %s at %s targetname // from %s to %s\n", self.classname, // vtos(self.s.origin), self.targetname, --- 161,165 ---- if ((self.targetname == null) || Lib.Q_stricmp(self.targetname, spot.targetname) != 0) { ! // gi.dprintf("FixCoopSpots changed %s at %s targetname // from %s to %s\n", self.classname, // vtos(self.s.origin), self.targetname, *************** *** 221,231 **** if (self.health < -40) { ! GameBase.gi ! .sound(self, Defines.CHAN_BODY, GameBase.gi ! .soundindex("misc/udeath.wav"), 1, ! Defines.ATTN_NORM, 0); for (n = 0; n < 4; n++) ! GameMisc.ThrowGib(self, ! "models/objects/gibs/sm_meat/tris.md2", damage, Defines.GIB_ORGANIC); self.s.origin[2] -= 48; --- 220,227 ---- if (self.health < -40) { ! GameBase.gi.sound(self, Defines.CHAN_BODY, ! GameBase.gi.soundindex("misc/udeath.wav"), 1, Defines.ATTN_NORM, 0); for (n = 0; n < 4; n++) ! GameMisc.ThrowGib(self, "models/objects/gibs/sm_meat/tris.md2", damage, Defines.GIB_ORGANIC); self.s.origin[2] -= 48; *************** *** 251,255 **** }; ! /* * QUAKED info_player_start (1 0 0) (-16 -16 -24) (16 16 32) The normal * starting point for a level. --- 247,251 ---- }; ! /** * QUAKED info_player_start (1 0 0) (-16 -16 -24) (16 16 32) The normal * starting point for a level. *************** *** 265,271 **** } ! /* * QUAKED info_player_deathmatch (1 0 1) (-16 -16 -24) (16 16 32) potential ! * spawning position for deathmatch games */ public static void SP_info_player_deathmatch(edict_t self) { --- 261,267 ---- } ! /** * QUAKED info_player_deathmatch (1 0 1) (-16 -16 -24) (16 16 32) potential ! * spawning position for deathmatch games. */ public static void SP_info_player_deathmatch(edict_t self) { *************** *** 277,283 **** } ! /* * QUAKED info_player_coop (1 0 1) (-16 -16 -24) (16 16 32) potential ! * spawning position for coop games */ --- 273,279 ---- } ! /** * QUAKED info_player_coop (1 0 1) (-16 -16 -24) (16 16 32) potential ! * spawning position for coop games. */ *************** *** 308,312 **** } ! /* * QUAKED info_player_intermission (1 0 1) (-16 -16 -24) (16 16 32) The * deathmatch intermission point will be at one of these Use 'angles' --- 304,308 ---- } ! /** * QUAKED info_player_intermission (1 0 1) (-16 -16 -24) (16 16 32) The * deathmatch intermission point will be at one of these Use 'angles' *************** *** 509,520 **** } ! //======================================================================= ! /* ! * ============== ! * InitClientPersistant ! * * This is only called when the game first initializes in single player, but ! * is called after each death and level change in deathmatch ! * ============== */ public static void InitClientPersistant(gclient_t client) { --- 505,511 ---- } ! /** * This is only called when the game first initializes in single player, but ! * is called after each death and level change in deathmatch. */ public static void InitClientPersistant(gclient_t client) { *************** *** 555,566 **** } ! /* ! * ================== ! * SaveClientData ! * * Some information that should be persistant, like health, is still stored * in the edict structure, so it needs to be mirrored out to the client * structure before all the edicts are wiped. - * ================== */ public static void SaveClientData() { --- 546,553 ---- } ! /** * Some information that should be persistant, like health, is still stored * in the edict structure, so it needs to be mirrored out to the client * structure before all the edicts are wiped. */ public static void SaveClientData() { *************** *** 591,600 **** } ! /* ! * ================ ! * PlayersRangeFromSpot ! * ! * Returns the distance to the nearest player from the given spot ! * ================ */ static float PlayersRangeFromSpot(edict_t spot) { --- 578,583 ---- } ! /** ! * Returns the distance to the nearest player from the given spot. */ static float PlayersRangeFromSpot(edict_t spot) { *************** *** 626,635 **** } ! /* ! * ================ ! * SelectRandomDeathmatchSpawnPoint ! * ! * go to a random point, but NOT the two points closest to other players ! * ================ */ public static edict_t SelectRandomDeathmatchSpawnPoint() { --- 609,614 ---- } ! /** ! * Go to a random point, but NOT the two points closest to other players. */ public static edict_t SelectRandomDeathmatchSpawnPoint() { *************** *** 686,694 **** } ! /* ! * ================ ! * SelectFarthestDeathmatchSpawnPoint ! * ! * ================ */ static edict_t SelectFarthestDeathmatchSpawnPoint() { --- 665,670 ---- } ! /** ! * If turned on in the dmflags, select a spawn point far away from other players. */ static edict_t SelectFarthestDeathmatchSpawnPoint() { *************** *** 703,707 **** EdictIterator es = null; while ((es = GameBase.G_Find(es, GameBase.findByClass, ! "info_player_deathmatch")).o != null) { spot = es.o; bestplayerdistance = PlayersRangeFromSpot(spot); --- 679,683 ---- EdictIterator es = null; while ((es = GameBase.G_Find(es, GameBase.findByClass, ! "info_player_deathmatch")) != null) { spot = es.o; bestplayerdistance = PlayersRangeFromSpot(spot); *************** *** 727,730 **** --- 703,707 ---- } + public static edict_t SelectDeathmatchSpawnPoint() { if (0 != ((int) (GameBase.dmflags.value) & Defines.DF_SPAWN_FARTHEST)) *************** *** 755,759 **** "info_player_coop"); - // nullpointer exi fixed (RST). if (es == null) return null; --- 732,735 ---- *************** *** 777,786 **** } ! /* ! * =========== ! * SelectSpawnPoint ! * ! * Chooses a player start, deathmatch start, coop start, etc ! * ============ */ public static void SelectSpawnPoint(edict_t ent, float[] origin, --- 753,758 ---- } ! /** ! * Chooses a player start, deathmatch start, coop start, etc. */ public static void SelectSpawnPoint(edict_t ent, float[] origin, *************** *** 836,840 **** } - //====================================================================== public static void InitBodyQue() { --- 808,811 ---- *************** *** 914,919 **** } ! /* ! * only ca... [truncated message content] |