]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/ecs/sv_main.qc
Uncrustify
[xonotic/xonotic-data.pk3dir.git] / qcsrc / ecs / sv_main.qc
1 // interpolating with the engine:
2 // it.movetype = MOVETYPE_STEP; // engine only interpolates this movetype
3 // it.flags |= FL_FLY;          // don't apply forces
4 // it.solid = SOLID_NOT;        // don't make stepping sounds
5
6 entity testent;
7
8 bool net_object_send(entity this, entity to, int sendflags)
9 {
10         WriteHeader(MSG_ENTITY, ENT_OBJECT);
11         serialize(ENT_OBJECT, MSG_ENTITY, this);
12         return true;
13 }
14
15 void spawnfunc_worldspawn()
16 {
17         static_init();
18         static_init_late();
19         // static_init_precache();
20
21         entity it = testent = spawn();
22         precache_model("models/player/erebus.iqm");
23         _setmodel(it, "models/player/erebus.iqm");
24
25         Net_LinkEntity(it, true, 0, net_object_send);
26 }
27
28 void PlayerPreThink(entity this)
29 {
30         // the truth: time
31         // what the client knows: time - this.ping
32         // for fairness, don't compensate shots beyond 400ms
33         // what the client sees: _ - this.cl_interp;
34 }
35
36 void StartFrame()
37 {
38         float f = 1 / autocvar_xon_sys_phys_dt;
39         float n = 5;
40         float x = ((floor(time * f) / f) % n) / n;
41         vector norg = '0 1 0' * x * 500;
42         if (norg != testent.origin)
43         {
44                 if (!norg) testent.effects |= EF_TELEPORT_BIT;
45                 testent.SendFlags |= 1;
46                 setorigin(testent, norg);
47                 testent.angles = '0 -360 0' * x;
48                 // testent.origin = norg;
49         }
50 }