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

Method touch

game/src/main/java/jake2/game/GameMisc.java:679–729  ·  view source on GitHub ↗
(SubgameEntity self, SubgameEntity other, cplane_t plane,
                          csurface_t surf, GameExportsImpl gameExports)

Source from the content-addressed store, hash-verified

677 private static EntTouchAdapter path_corner_touch = new EntTouchAdapter() {
678 public String getID() { return "path_corner_touch";}
679 public void touch(SubgameEntity self, SubgameEntity other, cplane_t plane,
680 csurface_t surf, GameExportsImpl gameExports) {
681 float[] v = { 0, 0, 0 };
682
683 if (other.movetarget != self)
684 return;
685
686 if (other.enemy != null)
687 return;
688
689 if (self.pathtarget != null) {
690 String savetarget;
691
692 savetarget = self.target;
693 self.target = self.pathtarget;
694 GameUtil.G_UseTargets(self, other, gameExports);
695 self.target = savetarget;
696 }
697
698 SubgameEntity next;
699 if (self.target != null)
700 next = GameBase.G_PickTarget(self.target, gameExports);
701 else
702 next = null;
703
704 if ((next != null) && (next.spawnflags & 1) != 0) {
705 Math3D.VectorCopy(next.s.origin, v);
706 v[2] += next.mins[2];
707 v[2] -= other.mins[2];
708 Math3D.VectorCopy(v, other.s.origin);
709 next = GameBase.G_PickTarget(next.target, gameExports);
710 other.s.event = Defines.EV_OTHER_TELEPORT;
711 }
712
713 other.goalentity = other.movetarget = next;
714
715 if (self.wait != 0) {
716 other.monsterinfo.pausetime = gameExports.level.time + self.wait;
717 other.monsterinfo.stand.think(other, gameExports);
718 return;
719 }
720
721 if (other.movetarget == null) {
722 other.monsterinfo.pausetime = gameExports.level.time + 100000000;
723 other.monsterinfo.stand.think(other, gameExports);
724 } else {
725 Math3D.VectorSubtract(other.goalentity.s.origin,
726 other.s.origin, v);
727 other.ideal_yaw = Math3D.vectoyaw(v);
728 }
729 }
730 };
731
732 /*

Callers 3

SV_ImpactMethod · 0.45
G_TouchTriggersMethod · 0.45
ClientThinkMethod · 0.45

Calls 15

G_UseTargetsMethod · 0.95
G_PickTargetMethod · 0.95
VectorCopyMethod · 0.95
VectorSubtractMethod · 0.95
vectoyawMethod · 0.95
vtosMethod · 0.95
M_walkmoveMethod · 0.95
T_RadiusDamageMethod · 0.95
BecomeExplosion2Method · 0.95
G_FindMethod · 0.95
VectorClearMethod · 0.95
getPlayerStateMethod · 0.95

Tested by

no test coverage detected