From: divverent Date: Sun, 18 Mar 2012 21:20:27 +0000 (+0000) Subject: checkpvs: use the right worldmodel X-Git-Tag: xonotic-v0.8.0~96^2~273 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ba53e4a4f414b39c5c38b9b00b072a363277f9a5;p=xonotic%2Fdarkplaces.git checkpvs: use the right worldmodel git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11764 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/clvm_cmds.c b/clvm_cmds.c index 1bc83027..cdb8f427 100644 --- a/clvm_cmds.c +++ b/clvm_cmds.c @@ -3763,36 +3763,36 @@ static void VM_CL_checkpvs (prvm_prog_t *prog) VectorAdd(PRVM_serveredictvector(viewee, origin), PRVM_serveredictvector(viewee, maxs), ma); #if 1 - if(!sv.worldmodel->brush.GetPVS || !sv.worldmodel->brush.BoxTouchingPVS) + if(!cl.worldmodel || !cl.worldmodel->brush.GetPVS || !cl.worldmodel->brush.BoxTouchingPVS) { // no PVS support on this worldmodel... darn PRVM_G_FLOAT(OFS_RETURN) = 3; return; } - pvs = sv.worldmodel->brush.GetPVS(sv.worldmodel, viewpos); + pvs = cl.worldmodel->brush.GetPVS(cl.worldmodel, viewpos); if(!pvs) { // viewpos isn't in any PVS... darn PRVM_G_FLOAT(OFS_RETURN) = 2; return; } - PRVM_G_FLOAT(OFS_RETURN) = sv.worldmodel->brush.BoxTouchingPVS(sv.worldmodel, pvs, mi, ma); + PRVM_G_FLOAT(OFS_RETURN) = cl.worldmodel->brush.BoxTouchingPVS(cl.worldmodel, pvs, mi, ma); #else // using fat PVS like FTEQW does (slow) - if(!sv.worldmodel->brush.FatPVS || !sv.worldmodel->brush.BoxTouchingPVS) + if(!cl.worldmodel || !cl.worldmodel->brush.FatPVS || !cl.worldmodel->brush.BoxTouchingPVS) { // no PVS support on this worldmodel... darn PRVM_G_FLOAT(OFS_RETURN) = 3; return; } - fatpvsbytes = sv.worldmodel->brush.FatPVS(sv.worldmodel, viewpos, 8, fatpvs, sizeof(fatpvs), false); + fatpvsbytes = cl.worldmodel->brush.FatPVS(cl.worldmodel, viewpos, 8, fatpvs, sizeof(fatpvs), false); if(!fatpvsbytes) { // viewpos isn't in any PVS... darn PRVM_G_FLOAT(OFS_RETURN) = 2; return; } - PRVM_G_FLOAT(OFS_RETURN) = sv.worldmodel->brush.BoxTouchingPVS(sv.worldmodel, fatpvs, mi, ma); + PRVM_G_FLOAT(OFS_RETURN) = cl.worldmodel->brush.BoxTouchingPVS(cl.worldmodel, fatpvs, mi, ma); #endif } diff --git a/svvm_cmds.c b/svvm_cmds.c index 92100b28..6612f27c 100644 --- a/svvm_cmds.c +++ b/svvm_cmds.c @@ -894,7 +894,7 @@ static void VM_SV_checkpvs(prvm_prog_t *prog) } #if 1 - if(!sv.worldmodel->brush.GetPVS || !sv.worldmodel->brush.BoxTouchingPVS) + if(!sv.worldmodel || !sv.worldmodel->brush.GetPVS || !sv.worldmodel->brush.BoxTouchingPVS) { // no PVS support on this worldmodel... darn PRVM_G_FLOAT(OFS_RETURN) = 3; @@ -910,7 +910,7 @@ static void VM_SV_checkpvs(prvm_prog_t *prog) PRVM_G_FLOAT(OFS_RETURN) = sv.worldmodel->brush.BoxTouchingPVS(sv.worldmodel, pvs, PRVM_serveredictvector(viewee, absmin), PRVM_serveredictvector(viewee, absmax)); #else // using fat PVS like FTEQW does (slow) - if(!sv.worldmodel->brush.FatPVS || !sv.worldmodel->brush.BoxTouchingPVS) + if(!sv.worldmodel || !sv.worldmodel->brush.FatPVS || !sv.worldmodel->brush.BoxTouchingPVS) { // no PVS support on this worldmodel... darn PRVM_G_FLOAT(OFS_RETURN) = 3;