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

Method M_walkmove

game/src/main/java/jake2/game/M.java:209–225  ·  view source on GitHub ↗

M_walkmove. @param yaw - where the entitiy is looking at (in degrees) @param dist - distance to travel during this frame

(SubgameEntity ent, float yaw, float dist, GameExportsImpl gameExports)

Source from the content-addressed store, hash-verified

207 * @param dist - distance to travel during this frame
208 */
209 public static boolean M_walkmove(SubgameEntity ent, float yaw, float dist, GameExportsImpl gameExports) {
210
211 // if we are falling (or swimming) and cannot fly (swim) -> return
212 if ((ent.groundentity == null)
213 && (ent.flags & (GameDefines.FL_FLY | GameDefines.FL_SWIM)) == 0)
214 return false;
215
216 float yaw_radian = (float) (yaw * Math.PI * 2 / 360);
217
218 float[] move = {
219 (float) Math.cos(yaw_radian) * dist,
220 (float) Math.sin(yaw_radian) * dist,
221 0
222 };
223
224 return SV.SV_movestep(ent, move, true, gameExports);
225 }
226
227 /**
228 * M_CatagorizePosition

Callers 4

ai_run_slideMethod · 0.95
thinkMethod · 0.95
aiMethod · 0.95
touchMethod · 0.95

Calls 1

SV_movestepMethod · 0.95

Tested by

no test coverage detected