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

Method respawn

game/src/main/java/jake2/game/PlayerClient.java:665–689  ·  view source on GitHub ↗
(SubgameEntity self, GameExportsImpl gameExports)

Source from the content-addressed store, hash-verified

663 }
664
665 public static void respawn(SubgameEntity self, GameExportsImpl gameExports) {
666 if (gameExports.gameCvars.deathmatch.value != 0 || gameExports.gameCvars.coop.value != 0) {
667 // spectator's don't leave bodies
668 if (self.movetype != GameDefines.MOVETYPE_NOCLIP)
669 CopyToBodyQue(self, gameExports);
670 self.svflags &= ~Defines.SVF_NOCLIENT;
671 PutClientInServer(self, gameExports);
672
673 // add a teleportation effect
674 self.s.event = Defines.EV_PLAYER_TELEPORT;
675
676 // hold in place briefly
677 gclient_t client = self.getClient();
678 client.getPlayerState().pmove.pm_flags = Defines.PMF_TIME_TELEPORT;
679 client.getPlayerState().pmove.pm_time = 14;
680
681 client.respawn_time = gameExports.level.time;
682
683 return;
684 }
685
686 // single player only
687 // restart the entire server
688 gameExports.gameImports.AddCommandString("menu_loadgame\n");
689 }
690
691 static boolean passwdOK(String i1, String i2) {
692 if (i1.length() != 0 && !i1.equals("none") && !i1.equals(i2))

Callers 2

BeginIntermissionMethod · 0.95

Calls 5

CopyToBodyQueMethod · 0.95
PutClientInServerMethod · 0.95
getPlayerStateMethod · 0.95
AddCommandStringMethod · 0.65
getClientMethod · 0.45

Tested by

no test coverage detected