X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fsv_main.qc;h=a10edf45b4173a8a01df3b1632aa0578430ca027;hp=aac9c497d1dabeaf7b901988a098a7128b14ed77;hb=05ee5b1212a6537e5c5acb76dbc1ef9df40f85c6;hpb=f6dd336135aa93ee4617df2389c3bfb28f0e1c58 diff --git a/qcsrc/server/sv_main.qc b/qcsrc/server/sv_main.qc index aac9c497d..a10edf45b 100644 --- a/qcsrc/server/sv_main.qc +++ b/qcsrc/server/sv_main.qc @@ -96,6 +96,7 @@ void CreatureFrame_Liquids(entity this) void CreatureFrame_FallDamage(entity this) { if(!IS_VEHICLE(this) && !(this.flags & FL_PROJECTILE)) // vehicles don't get falling damage + if(this.velocity || this.oldvelocity) // moving or has moved { // check for falling damage float velocity_len = vlen(this.velocity); @@ -118,7 +119,7 @@ void CreatureFrame_FallDamage(entity this) void CreatureFrame_All() { FOREACH_ENTITY_FLOAT(damagedbycontents, true, { - if (it.movetype == MOVETYPE_NOCLIP) continue; + if (it.move_movetype == MOVETYPE_NOCLIP) continue; CreatureFrame_Liquids(it); CreatureFrame_FallDamage(it); it.oldvelocity = it.velocity; @@ -152,19 +153,20 @@ Called before each frame by the server float game_delay; float game_delay_last; -bool autocvar_sv_autopause = true; +bool autocvar_sv_autopause = false; float RedirectionThink(); -void PM_Main(Client this); +void systems_update(); +void sys_phys_update(entity this, float dt); void StartFrame() { // TODO: if move is more than 50ms, split it into two moves (this matches QWSV behavior and the client prediction) - FOREACH_ENTITY_CLASS(STR_PLAYER, IS_FAKE_CLIENT(it), PM_Main(it)); - FOREACH_ENTITY_CLASS(STR_PLAYER, IS_FAKE_CLIENT(it), WITHSELF(it, PlayerPreThink())); + FOREACH_ENTITY_CLASS(STR_PLAYER, IS_FAKE_CLIENT(it), sys_phys_update(it, frametime)); + FOREACH_ENTITY_CLASS(STR_PLAYER, IS_FAKE_CLIENT(it), PlayerPreThink(it)); execute_next_frame(); if (autocvar_sv_autopause && !server_is_dedicated) Pause_TryPause(true); - remove = remove_unsafely; // not during spawning! + delete_fn = remove_unsafely; // not during spawning! serverprevtime = servertime; servertime = time; serverframetime = frametime; @@ -228,7 +230,7 @@ void StartFrame() MUTATOR_CALLHOOK(SV_StartFrame); FOREACH_CLIENT(true, GlobalStats_update(it)); - FOREACH_ENTITY_CLASS(STR_PLAYER, IS_FAKE_CLIENT(it), WITHSELF(it, PlayerPostThink())); + FOREACH_ENTITY_CLASS(STR_PLAYER, IS_FAKE_CLIENT(it), PlayerPostThink(it)); } .vector originjitter; @@ -237,8 +239,8 @@ void StartFrame() .string gametypefilter; .string cvarfilter; bool DoesQ3ARemoveThisEntity(entity this); -void SV_OnEntityPreSpawnFunction() -{ENGINE_EVENT(); +void SV_OnEntityPreSpawnFunction(entity this) +{ __spawnfunc_expecting = true; __spawnfunc_expect = this; if (this) @@ -367,6 +369,8 @@ LABEL(cvar_fail) return; } + this.move_movetype = this.movetype; + // support special -1 and -2 angle from radiant if (this.angles == '0 -1 0') this.angles = '-90 0 0';