MCPcopy Create free account
hub / github.com/demoth/jake2 / CopyToBodyQue

Method CopyToBodyQue

game/src/main/java/jake2/game/PlayerClient.java:631–663  ·  view source on GitHub ↗
(SubgameEntity ent, GameExportsImpl gameExports)

Source from the content-addressed store, hash-verified

629 }
630
631 public static void CopyToBodyQue(SubgameEntity ent, GameExportsImpl gameExports) {
632
633 // grab a body que and cycle to the next one
634 int i = (int) gameExports.game.maxclients + gameExports.level.body_que + 1;
635 SubgameEntity body = gameExports.g_edicts[i];
636 gameExports.level.body_que = (gameExports.level.body_que + 1)
637 % GameDefines.BODY_QUEUE_SIZE;
638
639 // FIXME: send an effect on the removed body
640
641 gameExports.gameImports.unlinkentity(ent);
642
643 gameExports.gameImports.unlinkentity(body);
644 body.s = ent.s.getClone();
645
646 body.s.number = body.index;
647
648 body.svflags = ent.svflags;
649 Math3D.VectorCopy(ent.mins, body.mins);
650 Math3D.VectorCopy(ent.maxs, body.maxs);
651 Math3D.VectorCopy(ent.absmin, body.absmin);
652 Math3D.VectorCopy(ent.absmax, body.absmax);
653 Math3D.VectorCopy(ent.size, body.size);
654 body.solid = ent.solid;
655 body.clipmask = ent.clipmask;
656 body.setOwner(ent.getOwner());
657 body.movetype = ent.movetype;
658
659 body.die = PlayerClient.body_die;
660 body.takedamage = Defines.DAMAGE_YES;
661
662 gameExports.gameImports.linkentity(body);
663 }
664
665 public static void respawn(SubgameEntity self, GameExportsImpl gameExports) {
666 if (gameExports.gameCvars.deathmatch.value != 0 || gameExports.gameCvars.coop.value != 0) {

Callers 1

respawnMethod · 0.95

Calls 6

VectorCopyMethod · 0.95
setOwnerMethod · 0.95
unlinkentityMethod · 0.65
linkentityMethod · 0.65
getCloneMethod · 0.45
getOwnerMethod · 0.45

Tested by

no test coverage detected