mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2025-03-27 12:59:09 +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++)
|
||||
{
|
||||
@ -786,16 +786,14 @@ void C_ServerActivate_Post(edict_t *pEdictList, int edictCount, int clientMax)
|
||||
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);
|
||||
precacheGroups(pStudioHeader);
|
||||
precacheSounds(pStudioHeader);
|
||||
}
|
||||
|
||||
REMOVE_ENTITY(pEntity);
|
||||
}
|
||||
|
||||
g_activated = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user