mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2025-04-01 15:29:05 +03:00
Replace entity creation by a variable
This commit is contained in:
parent
df4e565efd
commit
a1a45daaab
@ -770,7 +770,7 @@ void C_ServerActivate_Post(edict_t *pEdictList, int edictCount, int clientMax)
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto pEntity = CREATE_ENTITY();
|
edict_t entity;
|
||||||
|
|
||||||
for (auto index = 1u; index < ARRAYSIZE(Server->model_precache); index++)
|
for (auto index = 1u; index < ARRAYSIZE(Server->model_precache); index++)
|
||||||
{
|
{
|
||||||
@ -786,16 +786,14 @@ void C_ServerActivate_Post(edict_t *pEdictList, int edictCount, int clientMax)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
pEntity->v.modelindex = index;
|
entity.v.modelindex = index;
|
||||||
|
|
||||||
const auto pStudioHeader = static_cast<studiohdr_t *>(GET_MODEL_PTR(pEntity));
|
const auto pStudioHeader = static_cast<studiohdr_t *>(GET_MODEL_PTR(&entity));
|
||||||
|
|
||||||
precacheTextures(model, pStudioHeader);
|
precacheTextures(model, pStudioHeader);
|
||||||
precacheGroups(pStudioHeader);
|
precacheGroups(pStudioHeader);
|
||||||
precacheSounds(pStudioHeader);
|
precacheSounds(pStudioHeader);
|
||||||
}
|
}
|
||||||
|
|
||||||
REMOVE_ENTITY(pEntity);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
g_activated = true;
|
g_activated = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user