Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
resources.qc File Reference
#include "resources.qh"
Include dependency graph for resources.qc:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

float GetResourceField (Resource res_type)
 Converts resource type (a RES_* constant) to entity field.
Resource GetResourceType (.float res_field)
 Converts an entity field to resource type.

Function Documentation

◆ GetResourceField()

float GetResourceField ( Resource res_type)

Converts resource type (a RES_* constant) to entity field.

Parameters
[in]res_typeType of the resource.
Returns
Entity field for that resource.

Definition at line 11 of file resources.qc.

12{
13 return res_type.m_field;
14}
float m_field
Definition resources.qh:29

References Resource::m_field.

Referenced by SetResourceExplicit().

◆ GetResourceType()

Resource GetResourceType ( .float res_field)

Converts an entity field to resource type.

Parameters
[in]res_fieldEntity field to convert.
Returns
Resource type (a RES_* constant).

Definition at line 4 of file resources.qc.

5{
6 FOREACH(Resources, it.m_field == res_field, return it);
7 error("GetResourceType: Invalid field.");
8 return RES_NONE;
9}
#define FOREACH(list, cond, body)
Definition iter.qh:19
#define error
Definition pre.qh:6

References error, and FOREACH.