X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=host_cmd.c;h=b98566f6cea337b98932e0a31f6f2563147f3eff;hp=b88d27bcfd993d21693465b0e4a22ca5ce93ae2b;hb=aa33d8f8642530f7f266d6cde1422f95aa74b2be;hpb=838d1f2208ac272d6474eefdccba1c6021eaa9e8 diff --git a/host_cmd.c b/host_cmd.c index b88d27bc..b98566f6 100644 --- a/host_cmd.c +++ b/host_cmd.c @@ -294,7 +294,12 @@ void Host_Changelevel_f (void) Con_Print("changelevel : continue game on a new level\n"); return; } - if (!sv.active || cls.demoplayback) + // HACKHACKHACK + if (!sv.active) { + Host_Map_f(); + return; + } + if (cls.demoplayback) { Con_Print("Only the server may changelevel\n"); return; @@ -369,6 +374,11 @@ This is sent just before a server changes levels */ void Host_Reconnect_f (void) { + if (cmd_source == src_command) + { + Con_Print("reconnect is not valid from the console\n"); + return; + } if (Cmd_Argc() != 1) { Con_Print("reconnect : wait for signon messages again\n"); @@ -430,12 +440,14 @@ void Host_SavegameComment (char *text) for (i=0 ; iedict, eval_playermodel)->string = PRVM_SetEngineString(host_client->playermodel); if (strcmp(host_client->old_model, host_client->playermodel)) { - if (host_client->spawned) - SV_BroadcastPrintf("%s changed model to %s\n", host_client->name, host_client->playermodel); strcpy(host_client->old_model, host_client->playermodel); /*// send notification to all clients MSG_WriteByte (&sv.reliable_datagram, svc_updatepmodel); @@ -894,7 +904,7 @@ void Host_Say(qboolean teamonly) const char *p1; char *p2; // LordHavoc: 256 char say messages - unsigned char text[256]; + char text[256]; qboolean fromServer = false; if (cmd_source == src_command) @@ -926,9 +936,9 @@ void Host_Say(qboolean teamonly) p1++; } if (!fromServer) - dpsnprintf (text, sizeof(text), "%c%s: %s", 1, host_client->name, p1); + dpsnprintf (text, sizeof(text), "%c%s" STRING_COLOR_DEFAULT_STR ": %s", 1, host_client->name, p1); else - dpsnprintf (text, sizeof(text), "%c<%s> %s", 1, hostname.string, p1); + dpsnprintf (text, sizeof(text), "%c<%s" STRING_COLOR_DEFAULT_STR "> %s", 1, hostname.string, p1); p2 = text + strlen(text); while ((const char *)p2 > (const char *)text && (p2[-1] == '\r' || p2[-1] == '\n' || (p2[-1] == '\"' && quoted))) { @@ -1013,7 +1023,7 @@ void Host_Tell_f(void) } while (p2 > p1 && (p2[-1] == '\n' || p2[-1] == '\r')) p2--; - for (j = strlen(text);j < (int)(sizeof(text) - 2) && p1 < p2;) + for (j = (int)strlen(text);j < (int)(sizeof(text) - 2) && p1 < p2;) text[j++] = *p1++; text[j++] = '\n'; text[j++] = 0; @@ -1181,6 +1191,7 @@ void Host_Pause_f (void) ====================== Host_PModel_f LordHavoc: only supported for Nehahra, I personally think this is dumb, but Mindcrime won't listen. +LordHavoc: correction, Mindcrime will be removing pmodel in the future, but it's still stuck here for compatibility. ====================== */ cvar_t cl_pmodel = {CVAR_SAVE, "_cl_pmodel", "0"}; @@ -1674,9 +1685,9 @@ void Host_Viewmodel_f (void) return; m = Mod_ForName (Cmd_Argv(1), false, true, false); - if (!m) + if (!m || !m->loaded || !m->Draw) { - Con_Printf("Can't load %s\n", Cmd_Argv(1)); + Con_Printf("viewmodel: can't load %s\n", Cmd_Argv(1)); return; } @@ -1877,7 +1888,7 @@ static void MaxPlayers_f(void) if (svs.clients) Mem_Free(svs.clients); svs.maxclients = n; - svs.clients = Mem_Alloc(sv_mempool, sizeof(client_t) * svs.maxclients); + svs.clients = (client_t *)Mem_Alloc(sv_mempool, sizeof(client_t) * svs.maxclients); if (n == 1) Cvar_Set ("deathmatch", "0"); else