Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!

pointcontents

From Quake Wiki

float pointcontents(vector pos)

Usage[edit]

Gets what kind of contents exist at the given point. Only the world is taken into account for this, entities like monsters are ignored.

Parameters[edit]

  • pos
The position to get the contents from.

Return[edit]

One of the following:

  • CONTENT_EMPTY
Not inside anything.
  • CONTENT_SOLID
Inside of solid level geometry.
  • CONTENT_WATER
Inside of water.
  • CONTENT_SLIME
Inside of slime.
  • CONTENT_LAVA
Inside of lava.
  • CONTENT_SKY
Inside the sky.

Example[edit]

// If there's something at the given location, this function won't place the entity there
float CheckMove(vector pos)
{
    float contents = pointcontents(pos);
    if (contents != CONTENT_EMPTY)
        return FALSE;

    setorigin(self, pos);
    return TRUE;
}