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

Method KillBox

game/src/main/java/jake2/game/GameUtil.java:130–150  ·  view source on GitHub ↗

Kills all entities that would touch the proposed new positioning of ent. Ent should be unlinked before calling this!

(SubgameEntity ent, GameExportsImpl gameExports)

Source from the content-addressed store, hash-verified

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.

Callers 8

thinkMethod · 0.95
touchMethod · 0.95
PutClientInServerMethod · 0.95
targetEntities.ktFile · 0.80
explosive.ktFile · 0.80
killbox.ktFile · 0.80
wall.ktFile · 0.80
func_object.ktFile · 0.80

Calls 2

T_DamageMethod · 0.95
traceMethod · 0.65

Tested by

no test coverage detected