QuakeServer.Physics.Pushed (quake_server v0.1.0)

Copy Markdown View Source

What FTE's two pushes share (QuakeServer.Physics.Push and QuakeServer.Physics.PushTurn): which entities a pusher's move reaches, the pusher's blocked call, and putting moved entities back.

An entity is a candidate when it is not freed, its move type lets it be pushed, and it either stands on the pusher or overlaps the pusher's new box and is stuck there.

Summary

Functions

Run pusher's blocked with other as other, keeping self and other as they were.

The entities pusher's move may reach, by number, whose move type is not in skip: those standing on it, and those overlapping box {mins, maxs} (the pusher's new box) that are stuck there. {old_min, old_max} is the pusher's box before it moved.

Whether entity is a box with no width, which a pusher never blocks on.

Flatten entity to a point at its feet and relink it.

Whether pusher is a liquid brush (negative skin), which moves things but never blocks.

Whether entity stands somewhere.

Whether entity stands on pusher.

Whether entity is not solid or a box trigger: flattened rather than blocking.

Clear entity's on-ground flag.

Functions

blocked(server, pusher, other)

Run pusher's blocked with other as other, keeping self and other as they were.

candidates(server, pusher, box, arg, skip)

@spec candidates(
  QuakeServer.Server.t(),
  non_neg_integer(),
  {tuple(), tuple()},
  {tuple(), tuple()},
  [
    integer()
  ]
) :: [non_neg_integer()]

The entities pusher's move may reach, by number, whose move type is not in skip: those standing on it, and those overlapping box {mins, maxs} (the pusher's new box) that are stuck there. {old_min, old_max} is the pusher's box before it moved.

flat?(server, entity)

Whether entity is a box with no width, which a pusher never blocks on.

flatten(server, entity)

Flatten entity to a point at its feet and relink it.

liquid?(server, pusher)

@spec liquid?(QuakeServer.Server.t(), non_neg_integer()) :: boolean()

Whether pusher is a liquid brush (negative skin), which moves things but never blocks.

on_ground?(server, entity)

@spec on_ground?(QuakeServer.Server.t(), non_neg_integer()) :: boolean()

Whether entity stands somewhere.

rider?(server, pusher, entity)

Whether entity stands on pusher.

soft?(server, entity)

Whether entity is not solid or a box trigger: flattened rather than blocking.

unground(server, entity)

Clear entity's on-ground flag.