summaryrefslogtreecommitdiffstats
path: root/src/jake2/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/jake2/game')
-rw-r--r--src/jake2/game/GameAIAdapters.java27
-rw-r--r--src/jake2/game/GameMiscAdapters.java4
-rw-r--r--src/jake2/game/PlayerClient.java4
-rw-r--r--src/jake2/game/client_persistant_t.java21
-rw-r--r--src/jake2/game/client_respawn_t.java4
-rw-r--r--src/jake2/game/cplane_t.java25
-rw-r--r--src/jake2/game/player_state_t.java4
-rw-r--r--src/jake2/game/trace_t.java28
8 files changed, 61 insertions, 56 deletions
diff --git a/src/jake2/game/GameAIAdapters.java b/src/jake2/game/GameAIAdapters.java
index ea20995..465e4a3 100644
--- a/src/jake2/game/GameAIAdapters.java
+++ b/src/jake2/game/GameAIAdapters.java
@@ -19,11 +19,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// Created on 26.02.2004 by RST.
-// $Id: GameAIAdapters.java,v 1.1 2004-07-08 15:58:44 hzi Exp $
+// $Id: GameAIAdapters.java,v 1.2 2004-07-08 20:24:29 hzi Exp $
package jake2.game;
import jake2.Defines;
+import jake2.Globals;
import jake2.client.M;
import jake2.qcommon.Com;
import jake2.util.*;
@@ -253,11 +254,11 @@ public class GameAIAdapters
if (self.monsterinfo.idle_time != 0)
{
self.monsterinfo.search.think(self);
- self.monsterinfo.idle_time = GameBase.level.time + 15 + Lib.random() * 15;
+ self.monsterinfo.idle_time = GameBase.level.time + 15 + Globals.rnd.nextFloat() * 15;
}
else
{
- self.monsterinfo.idle_time = GameBase.level.time + Lib.random() * 15;
+ self.monsterinfo.idle_time = GameBase.level.time + Globals.rnd.nextFloat() * 15;
}
}
}
@@ -314,11 +315,11 @@ public class GameAIAdapters
if (self.monsterinfo.idle_time != 0)
{
self.monsterinfo.idle.think(self);
- self.monsterinfo.idle_time = GameBase.level.time + 15 + Lib.random() * 15;
+ self.monsterinfo.idle_time = GameBase.level.time + 15 + Globals.rnd.nextFloat() * 15;
}
else
{
- self.monsterinfo.idle_time = GameBase.level.time + Lib.random() * 15;
+ self.monsterinfo.idle_time = GameBase.level.time + Globals.rnd.nextFloat() * 15;
}
}
}
@@ -846,12 +847,14 @@ public class GameAIAdapters
trace_t tr;
float[] dest = { 0, 0, 0 };
- float v[];
+ //float v[];
- v = Lib.tv(-15, -15, -15);
- Math3D.VectorCopy(v, ent.mins);
- v = Lib.tv(15, 15, 15);
- Math3D.VectorCopy(v, ent.maxs);
+ //v = Lib.tv(-15, -15, -15);
+ //Math3D.VectorCopy(v, ent.mins);
+ ent.mins[0] = ent.mins[1] = ent.mins[2] = -15;
+ //v = Lib.tv(15, 15, 15);
+ //Math3D.VectorCopy(v, ent.maxs);
+ ent.maxs[0] = ent.maxs[1] = ent.maxs[2] = 15;
if (ent.model != null)
GameBase.gi.setmodel(ent, ent.model);
@@ -861,7 +864,7 @@ public class GameAIAdapters
ent.movetype = Defines.MOVETYPE_TOSS;
ent.touch = GameUtilAdapters.Touch_Item;
- v = Lib.tv(0, 0, -128);
+ float v[] = {0, 0, -128};
Math3D.VectorAdd(ent.s.origin, v, dest);
tr = GameBase.gi.trace(ent.s.origin, ent.mins, ent.maxs, dest, ent, Defines.MASK_SOLID);
@@ -918,7 +921,7 @@ public class GameAIAdapters
if (self.s.frame == 10)
{
self.think = GameUtilAdapters.G_FreeEdictA;
- self.nextthink = GameBase.level.time + 8 + Lib.random() * 10;
+ self.nextthink = GameBase.level.time + 8 + Globals.rnd.nextFloat() * 10;
}
return true;
}
diff --git a/src/jake2/game/GameMiscAdapters.java b/src/jake2/game/GameMiscAdapters.java
index c4322d3..56aba1a 100644
--- a/src/jake2/game/GameMiscAdapters.java
+++ b/src/jake2/game/GameMiscAdapters.java
@@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// Created on 26.02.2004 by RST.
-// $Id: GameMiscAdapters.java,v 1.1 2004-07-08 15:58:44 hzi Exp $
+// $Id: GameMiscAdapters.java,v 1.2 2004-07-08 20:24:29 hzi Exp $
package jake2.game;
@@ -817,7 +817,7 @@ public class GameMiscAdapters
if (e.count == 0)
continue;
n = e.count - 1;
- if (n > l)
+ if (n >= l)
{
e.s.frame = 12;
continue;
diff --git a/src/jake2/game/PlayerClient.java b/src/jake2/game/PlayerClient.java
index ba75cde..a7d06dd 100644
--- a/src/jake2/game/PlayerClient.java
+++ b/src/jake2/game/PlayerClient.java
@@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// Created on 28.12.2003 by RST.
-// $Id: PlayerClient.java,v 1.2 2004-07-08 15:58:43 hzi Exp $
+// $Id: PlayerClient.java,v 1.3 2004-07-08 20:24:29 hzi Exp $
package jake2.game;
@@ -334,7 +334,7 @@ public class PlayerClient extends PlayerHud {
//memset(& client.resp, 0, sizeof(client.resp));
client.resp.clear(); // ok.
client.resp.enterframe = level.framenum;
- client.resp.coop_respawn = client.pers.getClone();
+ client.resp.coop_respawn.set(client.pers);
}
/*
diff --git a/src/jake2/game/client_persistant_t.java b/src/jake2/game/client_persistant_t.java
index 944767e..5014d3b 100644
--- a/src/jake2/game/client_persistant_t.java
+++ b/src/jake2/game/client_persistant_t.java
@@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// Created on 31.10.2003 by RST.
-// $Id: client_persistant_t.java,v 1.2 2004-07-08 15:58:44 hzi Exp $
+// $Id: client_persistant_t.java,v 1.3 2004-07-08 20:24:29 hzi Exp $
package jake2.game;
@@ -31,14 +31,14 @@ import java.nio.ByteBuffer;
public class client_persistant_t implements Cloneable {
- public client_persistant_t getClone() {
- try {
- return (client_persistant_t) this.clone();
- }
- catch (CloneNotSupportedException e) {
- return null;
- }
- }
+// public client_persistant_t getClone() {
+// try {
+// return (client_persistant_t) this.clone();
+// }
+// catch (CloneNotSupportedException e) {
+// return null;
+// }
+// }
public void set(client_persistant_t from)
{
@@ -50,7 +50,8 @@ public class client_persistant_t implements Cloneable {
max_health = from.max_health;
savedFlags = from.savedFlags;
selected_item = from.selected_item;
- inventory = Lib.clone(from.inventory);
+ System.arraycopy(from.inventory, 0, inventory, 0, inventory.length);
+ //inventory = Lib.clone(from.inventory);
max_bullets = from.max_bullets;
max_shells = from.max_shells;
max_rockets = from.max_rockets;
diff --git a/src/jake2/game/client_respawn_t.java b/src/jake2/game/client_respawn_t.java
index f24a15c..a2ed8d5 100644
--- a/src/jake2/game/client_respawn_t.java
+++ b/src/jake2/game/client_respawn_t.java
@@ -18,7 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// Created on 31.10.2003 by RST.
-// $Id: client_respawn_t.java,v 1.2 2004-07-08 15:58:44 hzi Exp $
+// $Id: client_respawn_t.java,v 1.3 2004-07-08 20:24:29 hzi Exp $
package jake2.game;
@@ -42,7 +42,7 @@ public class client_respawn_t
coop_respawn.set(from.coop_respawn);
enterframe = from.enterframe;
score = from.score;
- cmd_angles = Lib.clone(cmd_angles);
+ cmd_angles = Lib.clone(from.cmd_angles);
spectator = from.spectator;
}
diff --git a/src/jake2/game/cplane_t.java b/src/jake2/game/cplane_t.java
index 2eb29e9..4465a76 100644
--- a/src/jake2/game/cplane_t.java
+++ b/src/jake2/game/cplane_t.java
@@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// Created on 31.10.2003 by RST.
-// $Id: cplane_t.java,v 1.2 2004-07-08 15:58:44 hzi Exp $
+// $Id: cplane_t.java,v 1.3 2004-07-08 20:24:29 hzi Exp $
package jake2.game;
@@ -34,17 +34,18 @@ public class cplane_t
public byte signbits; // signx + (signy<<1) + (signz<<1)
public byte pad[] = { 0, 0 };
- public cplane_t getClone()
- {
- cplane_t out = new cplane_t();
- out.normal = Lib.clone(normal);
- out.dist = dist;
- out.type = type;
- out.signbits = signbits;
- out.pad = Lib.clone(pad);
-
- return out;
- }
+// public cplane_t getClone()
+// {
+// cplane_t out = new cplane_t();
+// Math3D.set(out.normal, normal);
+// out.dist = dist;
+// out.type = type;
+// out.signbits = signbits;
+// out.pad[0] = pad[0];
+// out.pad[1] = pad[1];
+//
+// return out;
+// }
public void set(cplane_t c)
{
diff --git a/src/jake2/game/player_state_t.java b/src/jake2/game/player_state_t.java
index f8d4860..3ecc17d 100644
--- a/src/jake2/game/player_state_t.java
+++ b/src/jake2/game/player_state_t.java
@@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// Created on 31.10.2003 by RST.
-// $Id: player_state_t.java,v 1.1 2004-07-07 19:59:26 hzi Exp $
+// $Id: player_state_t.java,v 1.2 2004-07-08 20:24:29 hzi Exp $
package jake2.game;
@@ -95,7 +95,7 @@ public class player_state_t {
fov = from.fov;
rdflags = from.rdflags;
- stats = new short[Defines.MAX_STATS];
+ //stats = new short[Defines.MAX_STATS];
System.arraycopy(from.stats, 0, stats,0, Defines.MAX_STATS);
return this;
diff --git a/src/jake2/game/trace_t.java b/src/jake2/game/trace_t.java
index efb65fb..ac6d413 100644
--- a/src/jake2/game/trace_t.java
+++ b/src/jake2/game/trace_t.java
@@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// Created on 31.10.2003 by RST.
-// $Id: trace_t.java,v 1.2 2004-07-08 15:58:44 hzi Exp $
+// $Id: trace_t.java,v 1.3 2004-07-08 20:24:29 hzi Exp $
package jake2.game;
@@ -44,23 +44,23 @@ public class trace_t implements Cloneable {
allsolid = from.allsolid;
startsolid = from.allsolid;
fraction = from.fraction;
- endpos = Lib.clone(endpos);
- plane = from.plane.getClone();
+ endpos = Lib.clone(from.endpos);
+ plane.set(from.plane);
surface = from.surface;
contents = from.contents;
ent = from.ent;
}
// =============
- public trace_t getClone() {
- trace_t out = null;
- try {
- out = (trace_t) this.clone();
- out.plane = plane.getClone();
- endpos = Lib.clone(endpos);
- }
- catch (CloneNotSupportedException e) {
- }
- return out;
- }
+// public trace_t getClone() {
+// trace_t out = null;
+// try {
+// out = (trace_t) this.clone();
+// out.plane = plane.getClone();
+// out.endpos = Lib.clone(endpos);
+// }
+// catch (CloneNotSupportedException e) {
+// }
+// return out;
+// }
}