From: Mario Date: Mon, 4 Jan 2016 06:53:56 +0000 (+1000) Subject: Minor maths improvements X-Git-Tag: xonotic-v0.8.2~1289 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=78a383471dbdd76bdc61e47747b8b6a9ce24498e;p=xonotic%2Fxonotic-data.pk3dir.git Minor maths improvements --- diff --git a/qcsrc/lib/warpzone/server.qc b/qcsrc/lib/warpzone/server.qc index 21f69a80d..e9fdf771a 100644 --- a/qcsrc/lib/warpzone/server.qc +++ b/qcsrc/lib/warpzone/server.qc @@ -873,7 +873,8 @@ void WarpZone_StartFrame() if(warpzone_warpzones_exist) WarpZone_StoreProjectileData(it); - if((IS_OBSERVER(it) || it.solid == SOLID_NOT) && IS_REAL_CLIENT(it)) + if((IS_OBSERVER(it) || it.solid == SOLID_NOT)) + if(IS_REAL_CLIENT(it)) { other = it; // player diff --git a/qcsrc/server/g_subs.qc b/qcsrc/server/g_subs.qc index ecba3669a..5c2896dbe 100644 --- a/qcsrc/server/g_subs.qc +++ b/qcsrc/server/g_subs.qc @@ -235,11 +235,9 @@ vector findbetterlocation (vector org, float mindist) float LOD_customize() {SELFPARAM(); - float d; - if(autocvar_loddebug) { - d = autocvar_loddebug; + int d = autocvar_loddebug; if(d == 1) self.modelindex = self.lodmodelindex0; else if(d == 2 || !self.lodmodelindex2) @@ -250,10 +248,10 @@ float LOD_customize() } // TODO csqc network this so it only gets sent once - d = vlen(NearestPointOnBox(self, other.origin) - other.origin); - if(d < self.loddistance1) + vector near_point = NearestPointOnBox(self, other.origin); + if(vdist(near_point - other.origin, <, self.loddistance1)) self.modelindex = self.lodmodelindex0; - else if(!self.lodmodelindex2 || d < self.loddistance2) + else if(!self.lodmodelindex2 || vdist(near_point - other.origin, <, self.loddistance2)) self.modelindex = self.lodmodelindex1; else self.modelindex = self.lodmodelindex2;