Permalink
Browse files

Fix /client listmodels from MoreModels plugin

  • Loading branch information...
UnknownShadow200 committed Feb 9, 2019
1 parent 9419d55 commit 778a49130c4ab72f14efbf2e859aeea79efe4c3f
Showing with 14 additions and 26 deletions.
  1. +2 −7 src/Camera.c
  2. +1 −8 src/Chat.c
  3. +6 −0 src/Funcs.h
  4. +1 −7 src/Game.c
  5. +4 −4 src/Model.c
@@ -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) {

0 comments on commit 778a491

Please sign in to comment.