]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sv_user.c
Cleaned up alot more memory leaks. (still get 720 leaks just running demo1.dem)
[xonotic/darkplaces.git] / sv_user.c
index dec9d6c13868b153e1e228500156bff014e7079c..7015dd5011f4b35539296d0df1e9be79bea43710 100644 (file)
--- a/sv_user.c
+++ b/sv_user.c
@@ -688,10 +688,15 @@ void SV_ReadClientMove (usercmd_t *move)
                move->cursor_impact[0] = MSG_ReadFloat();
                move->cursor_impact[1] = MSG_ReadFloat();
                move->cursor_impact[2] = MSG_ReadFloat();
-               move->cursor_entitynumber = MSG_ReadShort();
+               move->cursor_entitynumber = (unsigned short)MSG_ReadShort();
+               if (move->cursor_entitynumber >= sv.max_edicts)
+               {
+                       Con_DPrintf("SV_ReadClientMessage: client send bad cursor_entitynumber\n");
+                       move->cursor_entitynumber = 0;
+               }
                // as requested by FrikaC, cursor_trace_ent is reset to world if the
                // entity is free at time of receipt
-               if (EDICT_NUM(move->cursor_entitynumber)->e->freed)
+               if (EDICT_NUM(move->cursor_entitynumber)->e->free)
                        move->cursor_entitynumber = 0;
                if (msg_badread) Con_Printf("SV_ReadClientMessage: badread at %s:%i\n", __FILE__, __LINE__);
        }
@@ -788,6 +793,8 @@ void SV_ReadClientMessage(void)
                         || strncasecmp(s, "ban", 3) == 0
                         || strncasecmp(s, "pmodel", 6) == 0
                         || strncasecmp(s, "rate", 4) == 0
+                        || strncasecmp(s, "playermodel", 11) == 0
+                        || strncasecmp(s, "playerskin", 10) == 0
                         || (gamemode == GAME_NEHAHRA && (strncasecmp(s, "max", 3) == 0 || strncasecmp(s, "monster", 7) == 0 || strncasecmp(s, "scrag", 5) == 0 || strncasecmp(s, "gimme", 5) == 0 || strncasecmp(s, "wraith", 6) == 0))
                         || (gamemode != GAME_NEHAHRA && (strncasecmp(s, "god", 3) == 0 || strncasecmp(s, "notarget", 8) == 0 || strncasecmp(s, "fly", 3) == 0 || strncasecmp(s, "give", 4) == 0 || strncasecmp(s, "noclip", 6) == 0)))
                                Cmd_ExecuteString (s, src_client);