Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
resources.qc
Go to the documentation of this file.
1#include "resources.qh"
2
3#ifdef GAMEQC
4Resource GetResourceType(.float res_field)
5{
6 FOREACH(Resources, it.m_field == res_field, return it);
7 error("GetResourceType: Invalid field.");
8 return RES_NONE;
9}
10
11.float GetResourceField(Resource res_type)
12{
13 return res_type.m_field;
14}
15#endif
float m_field
Definition resources.qh:29
#define FOREACH(list, cond, body)
Definition iter.qh:19
#define error
Definition pre.qh:6
Resource GetResourceType(.float res_field)
Converts an entity field to resource type.
Definition resources.qc:4
float GetResourceField(Resource res_type)
Converts resource type (a RES_* constant) to entity field.
Definition resources.qc:11