]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sv_user.c
hush some texture loading warnings in dedicated servers (thanks to Biomass for report...
[xonotic/darkplaces.git] / sv_user.c
index 77102a6925df5bd6b3fd9193a183dc62e09f9989..24cc9a7b3da248a18ea2dbccd9f0675240f6c549 100644 (file)
--- a/sv_user.c
+++ b/sv_user.c
@@ -688,7 +688,16 @@ 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->free)
+                       move->cursor_entitynumber = 0;
                if (msg_badread) Con_Printf("SV_ReadClientMessage: badread at %s:%i\n", __FILE__, __LINE__);
        }
        if ((val = GETEDICTFIELDVALUE(host_client->edict, eval_cursor_screen))) VectorCopy(move->cursor_screen, val->vector);
@@ -700,7 +709,7 @@ void SV_ReadClientMove (usercmd_t *move)
 void SV_FrameLost(int framenum)
 {
        if (host_client->entitydatabase5)
-               EntityFrame5_LostFrame(host_client->entitydatabase5, framenum, host_client - svs.clients + 1);
+               EntityFrame5_LostFrame(host_client->entitydatabase5, framenum);
 }
 
 void SV_FrameAck(int framenum)
@@ -784,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);