Kills all entities that would touch the proposed new positioning of ent. Ent should be unlinked before calling this!
(SubgameEntity ent, GameExportsImpl gameExports)
| 128 | * Ent should be unlinked before calling this! |
| 129 | */ |
| 130 | public static boolean KillBox(SubgameEntity ent, GameExportsImpl gameExports) { |
| 131 | |
| 132 | while (true) { |
| 133 | trace_t tr = gameExports.gameImports.trace(ent.s.origin, ent.mins, ent.maxs, |
| 134 | ent.s.origin, null, Defines.MASK_PLAYERSOLID); |
| 135 | SubgameEntity target = (SubgameEntity) tr.ent; |
| 136 | if (target == null || target == gameExports.g_edicts[0]) |
| 137 | break; |
| 138 | |
| 139 | // nail it |
| 140 | GameCombat.T_Damage(target, ent, ent, Globals.vec3_origin, ent.s.origin, |
| 141 | Globals.vec3_origin, 100000, 0, |
| 142 | DamageFlags.DAMAGE_NO_PROTECTION, GameDefines.MOD_TELEFRAG, gameExports); |
| 143 | |
| 144 | // if we didn't kill it, fail |
| 145 | if (target.solid != 0) |
| 146 | return false; |
| 147 | } |
| 148 | |
| 149 | return true; // all clear |
| 150 | } |
| 151 | |
| 152 | /** |
| 153 | * Returns true, if two edicts are on the same team. |
no test coverage detected