]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/models/model.qh
Merge branch 'Mario/weaponentities' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / models / model.qh
1 #pragma once
2
3 #define setmodel(e, m) _setmodel((e), (m).model_str())
4
5 CLASS(Model, Object)
6     ATTRIB(Model, m_id, int, 0)
7     ATTRIB(Model, model_str, string(), func_null)
8     CONSTRUCTOR(Model, string() path)
9     {
10         CONSTRUCT(Model);
11         this.model_str = path;
12     }
13     METHOD(Model, model_precache, void(Model this))
14     {
15         TC(Model, this);
16         string s = this.model_str();
17         if (s != "" && s != "null" && !fexists(s)) {
18             LOG_WARNF("Missing model: \"%s\"", s);
19             return;
20         }
21         profile(sprintf("precache_model(\"%s\")", s));
22         precache_model(s);
23     }
24 ENDCLASS(Model)