(SubgameEntity self, SubgameEntity other, cplane_t plane,
csurface_t surf, GameExportsImpl gameExports)
| 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 | /* |
no test coverage detected