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

Method think

game/src/main/java/jake2/game/M.java:366–386  ·  view source on GitHub ↗
(SubgameEntity ent, GameExportsImpl gameExports)

Source from the content-addressed store, hash-verified

364 public static EntThinkAdapter M_droptofloor = new EntThinkAdapter() {
365 public String getID() { return "m_drop_to_floor";}
366 public boolean think(SubgameEntity ent, GameExportsImpl gameExports) {
367 float[] end = { 0, 0, 0 };
368 trace_t trace;
369
370 ent.s.origin[2] += 1;
371 Math3D.VectorCopy(ent.s.origin, end);
372 end[2] -= 256;
373
374 trace = gameExports.gameImports.trace(ent.s.origin, ent.mins, ent.maxs, end,
375 ent, Defines.MASK_MONSTERSOLID);
376
377 if (trace.fraction == 1 || trace.allsolid)
378 return true;
379
380 Math3D.VectorCopy(trace.endpos, ent.s.origin);
381
382 gameExports.gameImports.linkentity(ent);
383 M.M_CheckGround(ent, gameExports);
384 setWaterLevel(ent, gameExports);
385 return true;
386 }
387 };
388
389 public static void M_SetEffects(SubgameEntity ent, float time) {

Callers 3

SV_RunThinkMethod · 0.45
runEntityMethod · 0.45
M_MoveFrameMethod · 0.45

Calls 6

VectorCopyMethod · 0.95
M_CheckGroundMethod · 0.95
setWaterLevelMethod · 0.95
traceMethod · 0.65
linkentityMethod · 0.65
soundindexMethod · 0.65

Tested by

no test coverage detected