]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into TimePath/ecs
authorTimePath <andrew.hardaker1995@gmail.com>
Fri, 15 Apr 2016 02:40:57 +0000 (12:40 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Fri, 15 Apr 2016 02:41:18 +0000 (12:41 +1000)
1  2 
qcsrc/ecs/sv_main.qc

index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..e3a36e4e6832dea2c5d3e6f729e31ecaf3b21c8f
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,49 @@@
++// interpolating with the engine:
++// it.movetype = MOVETYPE_STEP; // engine only interpolates this movetype
++// it.flags |= FL_FLY;          // don't apply forces
++// it.solid = SOLID_NOT;        // don't make stepping sounds
++
++entity testent;
++
++bool net_object_send(entity this, entity to, int sendflags) {
++    WriteHeader(MSG_ENTITY, ENT_OBJECT);
++    serialize(ENT_OBJECT, MSG_ENTITY, this);
++    return true;
++}
++
++void spawnfunc_worldspawn()
++{
++    static_init();
++    static_init_late();
++    // static_init_precache();
++
++      entity it = testent = spawn();
++      precache_model("models/player/erebus.iqm");
++      _setmodel(it, "models/player/erebus.iqm");
++
++      Net_LinkEntity(it, true, 0, net_object_send);
++}
++
++void PlayerPreThink(entity this)
++{
++      // the truth: time
++      // what the client knows: time - this.ping
++      // for fairness, don't compensate shots beyond 400ms
++      // what the client sees: _ - this.cl_interp;
++}
++
++void StartFrame()
++{
++      float f = 1 / autocvar_xon_sys_phys_dt;
++      float n = 5;
++      float x = ((floor(time * f) / f) % n) / n;
++      vector norg = '0 1 0' * x * 500;
++      if (norg != testent.origin)
++      {
++              if (!norg) testent.effects |= EF_TELEPORT_BIT;
++              testent.SendFlags |= 1;
++              setorigin(testent, norg);
++              testent.angles = '0 -360 0' * x;
++              // testent.origin = norg;
++      }
++}