MCPcopy Create free account
hub / github.com/demoth/jake2 / PF_setmodel

Method PF_setmodel

server/src/main/java/jake2/server/SV_GAME.java:103–119  ·  view source on GitHub ↗

PF_setmodel Also sets mins and maxs for inline bmodels.

(edict_t ent, String name)

Source from the content-addressed store, hash-verified

101 * Also sets mins and maxs for inline bmodels.
102 */
103 public void PF_setmodel(edict_t ent, String name) {
104
105 if (name == null) {
106 Com.DPrintf( "Error: SV_GAME.PF_setmodel: name is null");
107 return;
108 }
109
110 ent.s.modelindex = SV_FindIndex(name, Defines.CS_MODELS, Defines.MAX_MODELS, true);
111
112 // if it is an inline model, get the size information for it
113 if (name.startsWith("*")) {
114 cmodel_t mod = gameImports.cm.InlineModel(name);
115 Math3D.VectorCopy(mod.mins, ent.mins);
116 Math3D.VectorCopy(mod.maxs, ent.maxs);
117 SV_WORLD.SV_LinkEdict(ent, gameImports);
118 }
119 }
120
121 /**
122 * Change i-th configstring to 'val' and multicast it to everyone reliably

Callers 1

setmodelMethod · 0.80

Calls 5

DPrintfMethod · 0.95
SV_FindIndexMethod · 0.95
VectorCopyMethod · 0.95
SV_LinkEdictMethod · 0.95
InlineModelMethod · 0.80

Tested by

no test coverage detected