mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-17 11:35:08 -04:00
Fix /client listmodels from MoreModels plugin
This commit is contained in:
parent
9419d55de4
commit
778a49130c
@ -260,12 +260,7 @@ void Camera_CycleActive(void) {
|
||||
static struct Camera* cams_head;
|
||||
static struct Camera* cams_tail;
|
||||
void Camera_Register(struct Camera* cam) {
|
||||
if (!cams_head) {
|
||||
cams_head = cam;
|
||||
} else {
|
||||
cams_tail->Next = cam;
|
||||
}
|
||||
|
||||
cams_tail = cam;
|
||||
LinkedList_Add(cam, cams_head, cams_tail);
|
||||
/* want a circular linked list */
|
||||
cam->Next = cams_head;
|
||||
}
|
||||
|
@ -216,14 +216,7 @@ static bool Commands_IsCommandPrefix(const String* str) {
|
||||
}
|
||||
|
||||
void Commands_Register(struct ChatCommand* cmd) {
|
||||
if (!cmds_head) {
|
||||
cmds_head = cmd;
|
||||
} else {
|
||||
cmds_tail->Next = cmd;
|
||||
}
|
||||
|
||||
cmds_tail = cmd;
|
||||
cmd->Next = NULL;
|
||||
LinkedList_Add(cmd, cmds_head, cmds_tail);
|
||||
}
|
||||
|
||||
static struct ChatCommand* Commands_GetMatch(const String* cmdName) {
|
||||
|
@ -32,4 +32,10 @@ if (j - left <= right - i) {\
|
||||
if (i < right) { quickSort(i, right); }\
|
||||
right = j;\
|
||||
}
|
||||
|
||||
#define LinkedList_Add(item, head, tail)\
|
||||
if (!head) { head = item; } else { tail->Next = item; }\
|
||||
tail = item;\
|
||||
item->Next = NULL;
|
||||
|
||||
#endif
|
||||
|
@ -67,13 +67,7 @@ String Game_IPAddress = String_FromArray(Game_IPAddressBuffer);
|
||||
static struct IGameComponent* comps_head;
|
||||
static struct IGameComponent* comps_tail;
|
||||
void Game_AddComponent(struct IGameComponent* comp) {
|
||||
if (!comps_head) {
|
||||
comps_head = comp;
|
||||
} else {
|
||||
comps_tail->Next = comp;
|
||||
}
|
||||
comps_tail = comp;
|
||||
comp->Next = NULL;
|
||||
LinkedList_Add(comp, comps_head, comps_tail);
|
||||
}
|
||||
|
||||
int ScheduledTask_Add(double interval, ScheduledTaskCallback callback) {
|
||||
|
@ -364,7 +364,9 @@ void BoxDesc_ZQuad(struct Model* m, int texX, int texY, int texWidth, int texHei
|
||||
*--------------------------------------------------------Models common----------------------------------------------------*
|
||||
*#########################################################################################################################*/
|
||||
static struct Model* models_head;
|
||||
static struct Model* models_tail;
|
||||
static struct ModelTex* textures_head;
|
||||
static struct ModelTex* textures_tail;
|
||||
|
||||
#define Model_RetSize(x,y,z) static Vector3 P = { (x)/16.0f,(y)/16.0f,(z)/16.0f }; e->Size = P;
|
||||
#define Model_RetAABB(x1,y1,z1, x2,y2,z2) static struct AABB BB = { (x1)/16.0f,(y1)/16.0f,(z1)/16.0f, (x2)/16.0f,(y2)/16.0f,(z2)/16.0f }; e->ModelAABB = BB;
|
||||
@ -409,13 +411,11 @@ struct ModelTex* Model_GetTexture(const String* name) {
|
||||
}
|
||||
|
||||
void Model_Register(struct Model* model) {
|
||||
model->Next = models_head;
|
||||
models_head = model;
|
||||
LinkedList_Add(model, models_head, models_tail);
|
||||
}
|
||||
|
||||
void Model_RegisterTexture(struct ModelTex* tex) {
|
||||
tex->Next = textures_head;
|
||||
textures_head = tex;
|
||||
LinkedList_Add(tex, textures_head, textures_tail);
|
||||
}
|
||||
|
||||
static void Models_TextureChanged(void* obj, struct Stream* stream, const String* name) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user