X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Flib%2Fwarpzone%2Fserver.qc;h=6db6122352511d9640ac75baf603103a4e96ce65;hp=0b83f05bfa7d7436fc2664d04a39c76a2ee56659;hb=81062a39c99785039ceee2dcd187fed9352a08c5;hpb=c4230403a60e672acde0b6dfa32ca67f56879183 diff --git a/qcsrc/lib/warpzone/server.qc b/qcsrc/lib/warpzone/server.qc index 0b83f05bf..6db612235 100644 --- a/qcsrc/lib/warpzone/server.qc +++ b/qcsrc/lib/warpzone/server.qc @@ -5,9 +5,9 @@ #elif defined(MENUQC) #elif defined(SVQC) #include + #include #include #include - #include #include #include #endif @@ -114,7 +114,7 @@ float WarpZone_Teleport(entity wz, entity player, float f0, float f1) } else { - LOG_INFO("would have to put player in solid, won't do that\n"); + LOG_INFO("would have to put player in solid, won't do that"); setorigin(player, o0 - player.view_ofs); return 0; } @@ -225,7 +225,7 @@ void WarpZone_Touch(entity this, entity toucher) } else { - LOG_TRACE("WARPZONE FAIL AHAHAHAHAH))\n"); + LOG_TRACE("WARPZONE FAIL AHAHAHAHAH))"); } } @@ -348,13 +348,13 @@ float WarpZone_CheckProjectileImpact(entity player) return 0; #ifdef WARPZONELIB_REMOVEHACK - LOG_INFO("impactfilter found something - and it no longer gets handled correctly - please tell divVerent whether anything behaves broken now\n"); + LOG_INFO("impactfilter found something - and it no longer gets handled correctly - please tell divVerent whether anything behaves broken now"); #else - LOG_INFO("impactfilter found something - and it even gets handled correctly - please tell divVerent that this code apparently gets triggered again\n"); + LOG_INFO("impactfilter found something - and it even gets handled correctly - please tell divVerent that this code apparently gets triggered again"); #endif - LOG_INFO("Entity type: ", player.classname, "\n"); - LOG_INFO("Origin: ", vtos(player.origin), "\n"); - LOG_INFO("Velocity: ", vtos(player.velocity), "\n"); + LOG_INFO("Entity type: ", player.classname); + LOG_INFO("Origin: ", vtos(player.origin)); + LOG_INFO("Velocity: ", vtos(player.velocity)); #ifdef WARPZONELIB_REMOVEHACK return 0; @@ -583,7 +583,7 @@ void WarpZone_InitStep_UpdateTransform(entity this) point = point * (1 / (3 * area)); if(vdist(norm, <, 0.99)) { - LOG_INFO("trigger_warpzone near ", vtos(this.aiment.origin), " is nonplanar. BEWARE.\n"); + LOG_INFO("trigger_warpzone near ", vtos(this.aiment.origin), " is nonplanar. BEWARE."); area = 0; // no autofixing in this case } norm = normalize(norm); @@ -600,15 +600,15 @@ void WarpZone_InitStep_UpdateTransform(entity this) makevectors(ang); if(norm * v_forward < 0) { - LOG_INFO("Position target of trigger_warpzone near ", vtos(this.aiment.origin), " points into trigger_warpzone. BEWARE.\n"); + LOG_INFO("Position target of trigger_warpzone near ", vtos(this.aiment.origin), " points into trigger_warpzone. BEWARE."); norm = -1 * norm; } ang = vectoangles2(norm, v_up); // keep rotation, but turn exactly against plane ang.x = -ang.x; if(norm * v_forward < 0.99) - LOG_INFO("trigger_warpzone near ", vtos(this.aiment.origin), " has been turned to match plane orientation (", vtos(this.aiment.angles), " -> ", vtos(ang), "\n"); + LOG_INFO("trigger_warpzone near ", vtos(this.aiment.origin), " has been turned to match plane orientation (", vtos(this.aiment.angles), " -> ", vtos(ang)); if(vdist(org - this.aiment.origin, >, 0.5)) - LOG_INFO("trigger_warpzone near ", vtos(this.aiment.origin), " has been moved to match the plane (", vtos(this.aiment.origin), " -> ", vtos(org), ").\n"); + LOG_INFO("trigger_warpzone near ", vtos(this.aiment.origin), " has been moved to match the plane (", vtos(this.aiment.origin), " -> ", vtos(org), ")."); } } else if(area > 0) @@ -631,7 +631,6 @@ void WarpZone_InitStep_ClearTarget(entity this) this.enemy = NULL; } -entity warpzone_first; .entity warpzone_next; void WarpZone_InitStep_FindTarget(entity this) { float i; @@ -731,6 +730,8 @@ spawnfunc(trigger_warpzone) BITSET_ASSIGN(this.effects, EF_NODEPTHTEST); this.warpzone_next = warpzone_first; warpzone_first = this; + + IL_PUSH(g_warpzones, this); } spawnfunc(func_camera) { @@ -803,10 +804,19 @@ void WarpZone_StartFrame() WarpZone_PostInitialize_Callback(); } - FOREACH_ENTITY(!is_pure(it), + if(warpzone_warpzones_exist) { - if(warpzone_warpzones_exist) + IL_EACH(g_projectiles, true, + { WarpZone_StoreProjectileData(it); + }); + } + + + FOREACH_CLIENT(true, + { + if(warpzone_warpzones_exist) + WarpZone_StoreProjectileData(it); // TODO: not actually needed if(IS_OBSERVER(it) || it.solid == SOLID_NOT) if(IS_CLIENT(it)) // we don't care about it being a bot @@ -835,9 +845,10 @@ void WarpZone_StartFrame() .float warpzone_reconnecting; bool visible_to_some_client(entity ent) { - FOREACH_ENTITY(!IS_NOT_A_CLIENT(it), LAMBDA( - if (IS_PLAYER(it) && IS_REAL_CLIENT(it) && checkpvs(it.origin + it.view_ofs, ent)) return true; - )); + FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it) && checkpvs(it.origin + it.view_ofs, ent), + { + return true; + }); return false; } void trigger_warpzone_reconnect_use(entity this, entity actor, entity trigger) @@ -877,7 +888,7 @@ void WarpZone_PlayerPhysics_FixVAngle(entity this) #ifndef WARPZONE_DONT_FIX_VANGLE if(IS_REAL_CLIENT(this)) if(this.v_angle.z <= 360) // if not already adjusted - if(time - this.ping * 0.001 < this.warpzone_teleport_time) + if(time - CS(this).ping * 0.001 < this.warpzone_teleport_time) { this.v_angle = WarpZone_TransformVAngles(this.warpzone_teleport_zone, this.v_angle); this.v_angle_z += 720; // mark as adjusted