if (soundnum >= 256)
large = true;
+ if(sv.protocol == PROTOCOL_NEHAHRABJP)
+ large = false;
+
// add an svc_spawnambient command to the level signon packet
if (large)
MSG_WriteVector(&sv.signon, pos, sv.protocol);
- if (large || sv.protocol == PROTOCOL_NEHAHRABJP || sv.protocol == PROTOCOL_NEHAHRABJP2 || sv.protocol == PROTOCOL_NEHAHRABJP3)
+ if (large || sv.protocol == PROTOCOL_NEHAHRABJP2 || sv.protocol == PROTOCOL_NEHAHRABJP3)
MSG_WriteShort (&sv.signon, soundnum);
else
MSG_WriteByte (&sv.signon, soundnum);
if (PRVM_serveredictfloat(ent, modelindex) >= 256 || PRVM_serveredictfloat(ent, frame) >= 256)
large = true;
- if (large)
+ if (sv.protocol == PROTOCOL_NEHAHRABJP || sv.protocol == PROTOCOL_NEHAHRABJP2 || sv.protocol == PROTOCOL_NEHAHRABJP3)
{
- MSG_WriteByte (&sv.signon,svc_spawnstatic2);
+ MSG_WriteByte (&sv.signon,svc_spawnstatic);
MSG_WriteShort (&sv.signon, (int)PRVM_serveredictfloat(ent, modelindex));
- MSG_WriteShort (&sv.signon, (int)PRVM_serveredictfloat(ent, frame));
+ MSG_WriteByte (&sv.signon, (int)PRVM_serveredictfloat(ent, frame));
}
- else if (sv.protocol == PROTOCOL_NEHAHRABJP || sv.protocol == PROTOCOL_NEHAHRABJP2 || sv.protocol == PROTOCOL_NEHAHRABJP3)
+ else if (large)
{
- MSG_WriteByte (&sv.signon,svc_spawnstatic);
+ MSG_WriteByte (&sv.signon,svc_spawnstatic2);
MSG_WriteShort (&sv.signon, (int)PRVM_serveredictfloat(ent, modelindex));
- MSG_WriteByte (&sv.signon, (int)PRVM_serveredictfloat(ent, frame));
+ MSG_WriteShort (&sv.signon, (int)PRVM_serveredictfloat(ent, frame));
}
else
{
temp_client = host_client;
host_client = svs.clients + i;
- Cmd_ExecuteString(&cmd_serverfromclient, PRVM_G_STRING(OFS_PARM1), src_client, true);
+ Cmd_ExecuteString(cmd_serverfromclient, PRVM_G_STRING(OFS_PARM1), src_client, true);
host_client = temp_client;
}
qbool SV_VM_ConsoleCommand (const char *text)
{
prvm_prog_t *prog = SVVM_prog;
- int restorevm_tempstringsbuf_cursize;
- int save_self;
- qbool r = false;
-
- if(!sv.active || !prog || !prog->loaded)
- return false;
-
- if (PRVM_serverfunction(ConsoleCmd))
- {
- save_self = PRVM_serverglobaledict(self);
- PRVM_serverglobalfloat(time) = sv.time;
- restorevm_tempstringsbuf_cursize = prog->tempstringsbuf.cursize;
- PRVM_serverglobaledict(self) = PRVM_EDICT_TO_PROG(sv.world.prog->edicts);
- PRVM_G_INT(OFS_PARM0) = PRVM_SetTempString(prog, text);
- prog->ExecuteProgram(prog, PRVM_serverfunction(ConsoleCmd), "QC function ConsoleCmd is missing");
- prog->tempstringsbuf.cursize = restorevm_tempstringsbuf_cursize;
- PRVM_serverglobaledict(self) = save_self;
- r = (int) PRVM_G_FLOAT(OFS_RETURN) != 0;
- }
- return r;
+ return PRVM_ConsoleCommand(prog, text, &prog->funcoffsets.ConsoleCmd, true, PRVM_EDICT_TO_PROG(sv.world.prog->edicts), sv.time, !(!sv.active || !prog || !prog->loaded), "QC function ConsoleCmd is missing");
}
// #352 void(string cmdname) registercommand (EXT_CSQC)
static void VM_SV_registercommand (prvm_prog_t *prog)
{
VM_SAFEPARMCOUNT(1, VM_SV_registercmd);
- if(!Cmd_Exists(&cmd_server, PRVM_G_STRING(OFS_PARM0)))
+ if(!Cmd_Exists(cmd_local, PRVM_G_STRING(OFS_PARM0)))
Cmd_AddCommand(CF_SERVER, PRVM_G_STRING(OFS_PARM0), NULL, "console command created by QuakeC");
}
NULL, // #242
NULL, // #243
NULL, // #244
-NULL, // #245
+VM_modulo, // #245
NULL, // #246
NULL, // #247
NULL, // #248