]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Some more cleanup of defs.qh, use a flag to indicate crouch state instead of a separa...
authorMario <mario.mario@y7mail.com>
Sun, 2 Aug 2020 05:02:13 +0000 (15:02 +1000)
committerMario <mario.mario@y7mail.com>
Sun, 2 Aug 2020 05:02:13 +0000 (15:02 +1000)
47 files changed:
qcsrc/client/csqcmodel_hooks.qc
qcsrc/common/ent_cs.qc
qcsrc/common/gamemodes/gamemode/assault/sv_assault.qc
qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc
qcsrc/common/gamemodes/gamemode/keepaway/sv_keepaway.qc
qcsrc/common/gamemodes/gamemode/nexball/sv_nexball.qc
qcsrc/common/gamemodes/gamemode/race/sv_race.qc
qcsrc/common/mapobjects/defs.qh
qcsrc/common/mapobjects/models.qh
qcsrc/common/mapobjects/trigger/hurt.qh
qcsrc/common/mapobjects/triggers.qh
qcsrc/common/monsters/sv_monsters.qc
qcsrc/common/mutators/mutator/spawn_near_teammate/sv_spawn_near_teammate.qc
qcsrc/common/notifications/all.qc
qcsrc/common/physics/player.qc
qcsrc/common/physics/player.qh
qcsrc/common/turrets/sv_turrets.qc
qcsrc/common/turrets/turret/flac_weapon.qc
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/common/weapons/weapon/hlac.qc
qcsrc/common/weapons/weapon/porto.qh
qcsrc/lib/csqcmodel/cl_player.qh
qcsrc/server/anticheat.qc
qcsrc/server/bot/api.qh
qcsrc/server/bot/default/bot.qc
qcsrc/server/bot/default/havocbot/havocbot.qc
qcsrc/server/bot/default/navigation.qc
qcsrc/server/cheats.qc
qcsrc/server/client.qc
qcsrc/server/client.qh
qcsrc/server/command/common.qc
qcsrc/server/defs.qh
qcsrc/server/g_damage.qh
qcsrc/server/g_hook.qc
qcsrc/server/g_world.qh
qcsrc/server/impulse.qc
qcsrc/server/items/items.qh
qcsrc/server/mapvoting.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/player.qc
qcsrc/server/portals.qc
qcsrc/server/race.qc
qcsrc/server/scores.qc
qcsrc/server/spawnpoints.qh
qcsrc/server/sv_main.qh
qcsrc/server/teamplay.qc
qcsrc/server/weapons/common.qh

index 388d1a98298fb953b6c5a940e8057c608b7b2a96..319784a4a50c7c3d635b153b5c5497c20b99feb2 100644 (file)
@@ -7,6 +7,7 @@
 #include <common/animdecide.qh>
 #include <common/ent_cs.qh>
 #include <common/physics/movetypes/movetypes.qh>
+#include <common/physics/player.qh>
 #include <common/viewloc.qh>
 #include <common/effects/all.qh>
 #include <common/effects/all.inc>
index a7aa27961139530a73a9a7feda0d4ae1fe8d54f4..4ef6b2f793b819805c3a78c5f0fb0e32f190ab2d 100644 (file)
@@ -170,7 +170,7 @@ ENTCS_PROP(SOLID, true, sv_solid, solid, ENTCS_SET_NORMAL,
                do {
                        if (IS_PLAYER(player))
                        {
-                               if (radar_showennemies) break;
+                               if (radar_showenemies) break;
                                if (SAME_TEAM(to, player)) break;
                                if (!(IS_PLAYER(to) || to.caplayer) && time > game_starttime) break;
                        }
index 9a9a654de9c928d3ae5112a69c8308ebaaab4016..8c175554b10d8dc65678c3bf717b5cb81b907592 100644 (file)
@@ -1,6 +1,7 @@
 #include "sv_assault.qh"
 
 #include <common/mapobjects/func/breakable.qh>
+#include <server/spawnpoints.qh>
 
 .entity sprite;
 #define AS_ROUND_DELAY 5
index 9166f4f805060ffbff9b7e61ab0f4dd86fcb417f..bf0db40cd2a33b29496e95d092dbc6030e5b942d 100644 (file)
@@ -3,6 +3,7 @@
 #include <common/effects/all.qh>
 #include <common/vehicles/all.qh>
 #include <server/gamelog.qh>
+#include <server/g_damage.qh>
 #include <server/teamplay.qh>
 
 #include <lib/warpzone/common.qh>
index 735b01b3072f763ae0636b8da49f1015243525dd..0066af45156cd820fe160513edf5d5b01b3d6f36 100644 (file)
@@ -2,6 +2,7 @@
 
 #include <common/effects/all.qh>
 #include <server/gamelog.qh>
+#include <server/g_damage.qh>
 
 .entity ballcarried;
 
index 079b181f034b69e1bb53ab3f5cb04dcd812af948..cd73ea556787e79e4ab0d236a70c1b99ca32a54e 100644 (file)
@@ -953,7 +953,7 @@ REGISTER_MUTATOR(nb, false)
                CVTOV(g_nexball_delay_idle);                       //10
                CVTOV(g_nexball_football_physics);               //0
                */
-               radar_showennemies = autocvar_g_nexball_radar_showallplayers;
+               radar_showenemies = autocvar_g_nexball_radar_showallplayers;
 
                InitializeEntity(NULL, nb_delayedinit, INITPRIO_GAMETYPE);
                WEP_NEXBALL.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
index 29415649ec95a1e3da306d386d443c466848033f..35a7d950a18f86c2aa4b090d52fee65c95b509e0 100644 (file)
@@ -445,7 +445,7 @@ void race_Initialize()
        race_ScoreRules();
        if(g_race_qualifying == 2)
                warmup_stage = 0;
-       radar_showennemies = true;
+       radar_showenemies = true;
 }
 
 void rc_SetLimits()
index f65a9c22bce63ddaebc03bdcc5c3584f539592aa..40af5252e202d43f489751169447ee356783d3e8 100644 (file)
@@ -31,6 +31,8 @@ const int STATE_BOTTOM = 1;
 const int STATE_UP = 2;
 const int STATE_DOWN = 3;
 
+.int active;
+.void (entity this, int act_state) setactive;
 const int ACTIVE_NOT = 0;
 const int ACTIVE_ACTIVE = 1;
 const int ACTIVE_IDLE = 2;
index 8d2e98d15249afc104a471676c954b20c6666b0e..e1fb9095a16eebf15a537e19f16b4d134895aef3 100644 (file)
@@ -10,6 +10,11 @@ classfield(Wall) .int lodmodelindex0, lodmodelindex1, lodmodelindex2;
 classfield(Wall) .float loddistance1, loddistance2;
 classfield(Wall) .vector saved;
 
+void Ent_Wall_Draw(entity this);
+
+void Ent_Wall_Remove(entity this);
+#endif
+
 // Needed for interactive clientwalls
 .bool inactive; // Clientwall disappears when inactive
 .float alpha_max, alpha_min;
@@ -17,8 +22,3 @@ classfield(Wall) .vector saved;
 // fade_vertical_offset is a vertival offset for player position
 .float fade_start, fade_end, fade_vertical_offset;
 .float default_solid;
-
-void Ent_Wall_Draw(entity this);
-
-void Ent_Wall_Remove(entity this);
-#endif
index e992154aa97fd6a76cd6d7fc6d856ebb356eda4a..66f7568bd53e7f7d3a39b33a9ea2be4b8e16c864 100644 (file)
@@ -1,3 +1,7 @@
 #pragma once
 
+#ifdef SVQC
 const int HURT_SLOW = BIT(4);
+
+bool tracebox_hits_trigger_hurt(vector start, vector e_min, vector e_max, vector end);
+#endif
index 73113b4b51c69b004e6eaf02e6d924a481fd815e..513ff127edf5c3cae15ac41663c127bf02f33de7 100644 (file)
@@ -46,7 +46,6 @@ void generic_netlinked_legacy_use(entity this, entity actor, entity trigger);
 void trigger_common_read(entity this, bool withtarget);
 void trigger_remove_generic(entity this);
 
-.float active;
 .string target;
 .string targetname;
 #endif
index 136f3c411b7d3649758b72472f50428792780906..611321c45c05e3d022c52dad089a5eecb3752e17 100644 (file)
@@ -9,7 +9,9 @@
 #include "../weapons/_mod.qh"
 #include <server/autocvars.qh>
 #include <server/defs.qh>
+#include <server/g_damage.qh>
 #include "../deathtypes/all.qh"
+#include <server/items/items.qh>
 #include <server/mutators/_mod.qh>
 #include <server/steerlib.qh>
 #include "../turrets/sv_turrets.qh"
@@ -1145,7 +1147,7 @@ void Monster_Anim(entity this)
        int animbits = deadbits;
        if(STAT(FROZEN, this))
                animbits |= ANIMSTATE_FROZEN;
-       if(this.crouch)
+       if(IS_DUCKED(this))
                animbits |= ANIMSTATE_DUCK; // not that monsters can crouch currently...
        animdecide_setstate(this, animbits, false);
        animdecide_setimplicitstate(this, (IS_ONGROUND(this)));
index 2243c9872cba4d3ed6d1b1f4c47e25d7cf41a2e9..5c7505614e829734f2e074d4371abb824542bb1f 100644 (file)
@@ -1,5 +1,7 @@
 #include "sv_spawn_near_teammate.qh"
 
+#include <common/mapobjects/trigger/hurt.qh>
+
 #include <lib/float.qh>
 
 string autocvar_g_spawn_near_teammate;
index d6db436d0174b2fe672ef2da00a9dbe35aacec68..c8fb372d6bbbe74fb826fe67bcfa08f88b4d5412 100644 (file)
@@ -8,7 +8,7 @@
        #include <common/teams.qh>
        #include <server/autocvars.qh>
        #include <server/constants.qh>
-       #include <server/defs.qh>
+       #include <server/g_world.qh>
        #include <server/mutators/_mod.qh>
 #endif
 
index 2fd66af671f54ea1bb85cbde7f8b7a04f0d3ba7a..76bfb0334a9df8fe25f79cc7971fe78101cb8fae 100644 (file)
@@ -5,6 +5,7 @@
 #ifdef SVQC
 
 #include <server/miscfunctions.qh>
+#include <common/mapobjects/defs.qh>
 #include "../mapobjects/trigger/viewloc.qh"
 
 // client side physics
@@ -40,7 +41,7 @@ void Physics_UpdateStats(entity this)
        STAT(MOVEVARS_HIGHSPEED, this) = autocvar_g_movement_highspeed;
 
        MUTATOR_CALLHOOK(PlayerPhysics_UpdateStats, this);
-       float maxspd_mod = PHYS_HIGHSPEED(this) * ((this.swampslug.active) ? this.swampslug.swamp_slowdown : 1);
+       float maxspd_mod = PHYS_HIGHSPEED(this) * ((this.swampslug.active == ACTIVE_ACTIVE) ? this.swampslug.swamp_slowdown : 1);
         STAT(MOVEVARS_MAXSPEED, this) = Physics_ClientOption(this, "maxspeed", autocvar_sv_maxspeed) * maxspd_mod; // also slow walking
         if (autocvar_g_movement_highspeed_q3_compat) {
           STAT(MOVEVARS_AIRACCEL_QW, this) = Physics_ClientOption(this, "airaccel_qw", autocvar_sv_airaccel_qw);
index fc11cfab263185de02d7ccd67f3ce06069693fe3..4efb16f9d2ca35f53e39bb50c7612c865bf92a15 100644 (file)
@@ -7,6 +7,8 @@
        #include <common/state.qh>
 #endif
 
+const int FL_DUCKED = BIT(19);
+
 .entity conveyor;
 
 .float race_penalty;
@@ -155,6 +157,10 @@ STATIC_INIT(PHYS_INPUT_BUTTON)
 #define WAS_ONGROUND(s)                     boolean((s).lastflags & FL_ONGROUND)
 #define WAS_ONSLICK(s)                      boolean((s).lastflags & FL_ONSLICK)
 
+#define IS_DUCKED(s)                        (boolean((s).flags & FL_DUCKED))
+#define SET_DUCKED(s)                       ((s).flags |= FL_DUCKED)
+#define UNSET_DUCKED(s)                     ((s).flags &= ~FL_DUCKED)
+
 #define ITEMS_STAT(s)                       ((s).items)
 
 .float teleport_time;
@@ -224,10 +230,6 @@ STATIC_INIT(PHYS_INPUT_BUTTON)
        #define PHYS_INPUT_BUTTON_BUTTON15(s)       boolean(input_buttons & BIT(17))
        #define PHYS_INPUT_BUTTON_BUTTON16(s)       boolean(input_buttons & BIT(18))
 
-       #define IS_DUCKED(s)                        (boolean((s).flags & FL_DUCKED))
-       #define SET_DUCKED(s)                       ((s).flags |= FL_DUCKED)
-       #define UNSET_DUCKED(s)                     ((s).flags &= ~FL_DUCKED)
-
        #define PHYS_INVEHICLE(s)                                       (boolean(hud != HUD_NORMAL))
 
        #define PHYS_JUMPSPEEDCAP_MIN               autocvar_cl_jumpspeedcap_min
@@ -278,10 +280,6 @@ STATIC_INIT(PHYS_INPUT_BUTTON)
        #define PHYS_INPUT_BUTTON_BUTTON15(s)       (CS(s).button15)
        #define PHYS_INPUT_BUTTON_BUTTON16(s)       (CS(s).button16)
 
-       #define IS_DUCKED(s)                        ((s).crouch)
-       #define SET_DUCKED(s)                       ((s).crouch = true)
-       #define UNSET_DUCKED(s)                     ((s).crouch = false)
-
        #define PHYS_INVEHICLE(s)                                       (boolean((s).vehicle != NULL))
 
        #define PHYS_JUMPSPEEDCAP_MIN               autocvar_sv_jumpspeedcap_min
index 4b852d5986dfe0d9c92b648b3f5a004c46e67b5a..e72b625590622f5fe9f5d538966e4ea034d183e0 100644 (file)
@@ -1,6 +1,7 @@
 #include "sv_turrets.qh"
 #ifdef SVQC
 #include <server/autocvars.qh>
+#include <server/g_damage.qh>
 #include <server/weapons/weaponsystem.qh>
 #include <common/mapobjects/defs.qh>
 
@@ -426,11 +427,11 @@ void turret_projectile_explode(entity this)
        this.event_damage = func_null;
 #ifdef TURRET_DEBUG
        float d;
-       d = RadiusDamage (this, this.owner, this.owner.shot_dmg, 0, this.owner.shot_radius, this, NULL, this.owner.shot_force, this.totalfrags, DMG_NOWEP, NULL);
+       d = RadiusDamage (this, this.owner, this.owner.shot_dmg, 0, this.owner.shot_radius, this, NULL, this.owner.shot_force, this.projectiledeathtype, DMG_NOWEP, NULL);
        this.owner.tur_debug_dmg_t_h = this.owner.tur_debug_dmg_t_h + d;
        this.owner.tur_debug_dmg_t_f = this.owner.tur_debug_dmg_t_f + this.owner.shot_dmg;
 #else
-       RadiusDamage (this, this.realowner, this.owner.shot_dmg, 0, this.owner.shot_radius, this, NULL, this.owner.shot_force, this.totalfrags, DMG_NOWEP, NULL);
+       RadiusDamage (this, this.realowner, this.owner.shot_dmg, 0, this.owner.shot_radius, this, NULL, this.owner.shot_force, this.projectiledeathtype, DMG_NOWEP, NULL);
 #endif
        delete(this);
 }
@@ -472,7 +473,7 @@ entity turret_projectile(entity actor, Sound _snd, float _size, float _health, f
        IL_PUSH(g_projectiles, proj);
        IL_PUSH(g_bot_dodge, proj);
        proj.enemy                = actor.enemy;
-       proj.totalfrags  = _death;
+       proj.projectiledeathtype         = _death;
        PROJECTILE_MAKETRIGGER(proj);
        if(_health)
        {
index 64b5e20543f1639d0cf44c38f926262448a6fe71..ef7b60c8e83a2ed393112d1f0f513c7a81ec30af 100644 (file)
@@ -41,11 +41,11 @@ void turret_flac_projectile_think_explode(entity this)
         setorigin(this, this.enemy.origin + randomvec() * this.owner.shot_radius);
 
 #ifdef TURRET_DEBUG
-    float d = RadiusDamage (this, this.owner, this.owner.shot_dmg, this.owner.shot_dmg, this.owner.shot_radius, this, NULL, this.owner.shot_force, this.totalfrags, DMG_NOWEP, NULL);
+    float d = RadiusDamage (this, this.owner, this.owner.shot_dmg, this.owner.shot_dmg, this.owner.shot_radius, this, NULL, this.owner.shot_force, this.projectiledeathtype, DMG_NOWEP, NULL);
     this.owner.tur_debug_dmg_t_h = this.owner.tur_debug_dmg_t_h + d;
     this.owner.tur_debug_dmg_t_f = this.owner.tur_debug_dmg_t_f + this.owner.shot_dmg;
 #else
-    RadiusDamage (this, this.realowner, this.owner.shot_dmg, this.owner.shot_dmg, this.owner.shot_radius, this, NULL, this.owner.shot_force, this.totalfrags, DMG_NOWEP, NULL);
+    RadiusDamage (this, this.realowner, this.owner.shot_dmg, this.owner.shot_dmg, this.owner.shot_radius, this, NULL, this.owner.shot_force, this.projectiledeathtype, DMG_NOWEP, NULL);
 #endif
     delete(this);
 }
index f03e9dc6b4334b8f2fce53e3ffe4e83e49508cf8..066066f0bd3bab8d84a5076580ce0145346673fd 100644 (file)
@@ -1,5 +1,6 @@
 #include "sv_vehicles.qh"
 
+#include <server/g_damage.qh>
 #include <common/mapobjects/defs.qh>
 
 bool SendAuxiliaryXhair(entity this, entity to, int sf)
@@ -232,7 +233,7 @@ void vehicles_projectile_explode(entity this, entity toucher)
        PROJECTILE_TOUCH(this, toucher);
 
        this.event_damage = func_null;
-       RadiusDamage (this, this.realowner, this.shot_dmg, 0, this.shot_radius, this, NULL, this.shot_force, this.totalfrags, DMG_NOWEP, toucher);
+       RadiusDamage (this, this.realowner, this.shot_dmg, 0, this.shot_radius, this, NULL, this.shot_force, this.projectiledeathtype, DMG_NOWEP, toucher);
 
        delete(this);
 }
@@ -264,7 +265,7 @@ entity vehicles_projectile(entity this, entity _mzlfx, Sound _mzlsound,
        proj.shot_dmg            = _dmg;
        proj.shot_radius          = _radi;
        proj.shot_force    = _force;
-       proj.totalfrags    = _deahtype;
+       proj.projectiledeathtype           = _deahtype;
        proj.solid                      = SOLID_BBOX;
        set_movetype(proj, MOVETYPE_FLYMISSILE);
        proj.flags = FL_PROJECTILE;
@@ -1029,7 +1030,7 @@ void vehicles_enter(entity pl, entity veh)
 
        veh.vehicle_hudmodel.viewmodelforclient = pl;
 
-       pl.crouch = false;
+       UNSET_DUCKED(pl);
        pl.view_ofs = STAT(PL_VIEW_OFS, pl);
        setsize(pl, STAT(PL_MIN, pl), STAT(PL_MAX, pl));
 
index da2660b89e2ece43a4001f518393fede8a0eaf43..3bc2258207990046fa27fc71cc8428e45b00c709 100644 (file)
@@ -27,7 +27,7 @@ void W_HLAC_Attack(Weapon thiswep, entity actor, .entity weaponentity)
 
     spread = WEP_CVAR_PRI(hlac, spread_min) + (WEP_CVAR_PRI(hlac, spread_add) * actor.(weaponentity).misc_bulletcounter);
     spread = min(spread,WEP_CVAR_PRI(hlac, spread_max));
-    if(actor.crouch)
+    if(IS_DUCKED(actor))
         spread = spread * WEP_CVAR_PRI(hlac, spread_crouchmod);
 
        W_SetupShot(actor, weaponentity, false, 3, SND_LASERGUN_FIRE, CH_WEAPON_A, WEP_CVAR_PRI(hlac, damage), thiswep.m_id);
@@ -77,7 +77,7 @@ void W_HLAC_Attack2(Weapon thiswep, entity actor, .entity weaponentity)
     spread = WEP_CVAR_SEC(hlac, spread);
 
 
-    if(actor.crouch)
+    if(IS_DUCKED(actor))
         spread = spread * WEP_CVAR_SEC(hlac, spread_crouchmod);
 
        W_SetupShot(actor, weaponentity, false, 3, SND_LASERGUN_FIRE, CH_WEAPON_A, WEP_CVAR_SEC(hlac, damage), thiswep.m_id | HITTYPE_SECONDARY);
index 29820ef06baba6f4cc88eefbee9db167cd5a6246..6c1a6e7f2957a9ba08e14539df9ff66e9225a5dc 100644 (file)
@@ -50,4 +50,5 @@ void Porto_Draw(entity this);
 .float porto_forbidden;
 
 void W_Porto_Fail(entity this, float failhard);
+void W_Porto_Remove (entity p);
 #endif
index 92948dc5a92d119b34485fe649823fa67f0960a6..af708da25170f30287fb59507dc3c17c75034dca 100644 (file)
@@ -35,8 +35,6 @@ const int PMF_JUMP_HELD = 1;
 //const int PMF_DUCKED = 4;
 //const int PMF_ONGROUND = 8;
 
-const int FL_DUCKED = BIT(19);
-
 void CSQCPlayer_SetCamera();
 float CSQCPlayer_PreUpdate(entity this);
 float CSQCPlayer_PostUpdate(entity this);
index fa4af040b5e367cc436e8171076e19f61cb9d2d1..7637424c158b79b6d9acc8d6de3ea07d16380988 100644 (file)
@@ -4,6 +4,7 @@
 #include "autocvars.qh"
 #include "defs.qh"
 #include <server/gamelog.qh>
+#include <server/sv_main.qh>
 #include "miscfunctions.qh"
 
 #include "command/common.qh"
index 81baa2c196dd5042c2610de8707282272527797e..6c3d3141b2e96c27dbf822c73479af285941b97d 100644 (file)
@@ -95,6 +95,11 @@ float havocbot_symmetry_origin_order;
 .float ignoregoaltime;
 .entity ignoregoal;
 
+bool bots_would_leave;
+
+int player_count;
+int currentbots;
+
 .entity bot_basewaypoint;
 .bool navigation_dynamicgoal;
 void navigation_dynamicgoal_init(entity this, bool initially_static);
index bcf02da4bc6b4920890fe0aa41458f46c5379230..90ef1e2c9258ddbd195b18f8f2809bdb933801cd 100644 (file)
@@ -18,6 +18,7 @@
 #include "../../client.qh"
 #include "../../constants.qh"
 #include "../../defs.qh"
+#include <server/g_damage.qh>
 #include "../../race.qh"
 #include <server/items/items.qh>
 
index 296114539428e1758e3521976a70c26888101b95..d388b150526a34e7f7f44525d9283927546e8c4f 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <common/mapobjects/func/ladder.qh>
 #include <common/mapobjects/teleporters.qh>
+#include <common/mapobjects/trigger/hurt.qh>
 #include <common/mapobjects/trigger/jumppads.qh>
 
 #include <lib/warpzone/common.qh>
index 26d69abbd0ddf604396bf703c2657a5946673e82..4b65a69ccd292177fe9c345887a199acb428eed0 100644 (file)
@@ -14,6 +14,7 @@
 #include <common/constants.qh>
 #include <common/net_linked.qh>
 #include <common/mapobjects/func/ladder.qh>
+#include <common/mapobjects/trigger/hurt.qh>
 #include <common/mapobjects/trigger/jumppads.qh>
 
 .float speed;
index eda0838fd24e61d6a9a34078a936edefba74f15f..9167ca5e7753cb165b52474559df0223c4a0cbc1 100644 (file)
@@ -4,6 +4,7 @@
 #include <server/miscfunctions.qh>
 #include <common/effects/all.qh>
 #include <server/resources.qh>
+#include <server/sv_main.qh>
 
 #include "g_damage.qh"
 #include "clientkill.qh"
index c0d3898377679f67633108c3b672aeb3c3ba4375..0458b07af332d3b9f6b6d2d2c0ffdd3b4741ca7a 100644 (file)
@@ -349,7 +349,7 @@ void PutObserverInServer(entity this)
        setthink(this, func_null);
        this.nextthink = 0;
        this.deadflag = DEAD_NO;
-       this.crouch = false;
+       UNSET_DUCKED(this);
        STAT(REVIVE_PROGRESS, this) = 0;
        this.revival_time = 0;
        this.draggable = drag_undraggable;
@@ -678,7 +678,7 @@ void PutPlayerInServer(entity this)
 
        this.spawnpoint_targ = NULL;
 
-       this.crouch = false;
+       UNSET_DUCKED(this);
        this.view_ofs = STAT(PL_VIEW_OFS, this);
        setsize(this, STAT(PL_MIN, this), STAT(PL_MAX, this));
        this.spawnorigin = spot.origin;
index 328726df9ca696c7725fa538617550e7af8f64e2..2ad2d8f8d2c66d3048d1a0d7d2991cb550399fd1 100644 (file)
@@ -231,10 +231,22 @@ METHOD(Client, m_unwind, bool(Client this))
     return false;
 }
 
+//flood fields
+.float nickspamtime; // time of last nick change
+.float nickspamcount;
+.float floodcontrol_chat;
+.float floodcontrol_chatteam;
+.float floodcontrol_chattell;
+.float floodcontrol_voice;
+.float floodcontrol_voiceteam;
+
+// respawning
 .int respawn_flags;
 .float respawn_time;
 .float respawn_time_max;
 
+.float respawn_countdown; // next number to count
+
 // g_<gametype>_str:
 // If 0, default is used.
 // If <0, 0 is used.
@@ -252,6 +264,19 @@ bool PlayerInList(entity player, string list);
 
 void ClientData_Touch(entity e);
 
+int nJoinAllowed(entity this, entity ignore);
+
+void FixIntermissionClient(entity e);
+
+void checkSpectatorBlock(entity this);
+
+void PlayerUseKey(entity this);
+
+void FixClientCvars(entity e);
+
+// called when a client connects, useful for updating sounds and such of static objects
+.void(entity this, entity player) init_for_player;
+
 /// \brief Print the string to the client's chat.
 /// \param[in] client Client to print to.
 /// \param[in] text Text to print.
index 32ccd883e97d28d0ebbce901bdd67cf8e2b4399d..c9e8b595e289c71e71be84753164447a054ba78f 100644 (file)
@@ -1,5 +1,6 @@
 #include "common.qh"
 
+#include <server/client.qh>
 #include <server/defs.qh>
 #include <server/miscfunctions.qh>
 
index 3d1e61478c2863c71c3635fec0402de7fc5d9195..7b8e06371bec8533c735cb05e1885d7342916c94 100644 (file)
@@ -18,15 +18,6 @@ bool sv_ready_restart_repeatable;
 float sv_clones;
 float sv_foginterval;
 
-float player_count;
-float currentbots;
-float bots_would_leave;
-
-.int totalfrags; // NOTE: reused for multiple purposes
-
-// flag set on worldspawn so that the code knows if it is dedicated or not
-float server_is_dedicated;
-
 // Fields
 
 .void(entity this, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force) event_damage;
@@ -37,15 +28,9 @@ float server_is_dedicated;
 //.string      map;
 
 //.float       worldtype;
-// Needed for dynamic clientwalls
-.bool inactive; // Clientwall disappears when inactive
-.float alpha_max, alpha_min;
-.float fade_start, fade_end, fade_vertical_offset;
-.float default_solid; // Variable to store default .solid for clientwalls
 
 .float pain_finished;                  //Added by Supajoe
 .float pain_frame;                     //"
-.float  crouch;        // Crouching or not?
 
 .float superweapons_finished; // NOTE: this field is used only by map entities, it does not directly apply the superweapons stat
 const .float air_finished = _STAT(AIR_FINISHED);
@@ -71,11 +56,6 @@ const .float air_finished = _STAT(AIR_FINISHED);
 .float respawntimestart;
 //.float       chasecam;
 
-.float damageforcescale;
-const float MIN_DAMAGEEXTRARADIUS = 2;
-const float MAX_DAMAGEEXTRARADIUS = 16;
-.float damageextraradius;
-
 //.float          gravity;
 
 .float         dmg;
@@ -118,7 +98,6 @@ float alreadychangedlevel;
 
 float blockSpectators; //if set, new or existing spectators or observers will be removed unless they become a player within g_maxplayers_spectator_blocktime seconds
 .float spectatortime; //point in time since the client is spectating or observing
-void checkSpectatorBlock(entity this);
 
 .float winning;
 .float jointime; // time of connecting
@@ -126,10 +105,7 @@ void checkSpectatorBlock(entity this);
 .float alivetime; // time of being alive
 .float motd_actived_time; // used for both motd and campaign_message
 
-int nJoinAllowed(entity this, entity ignore);
-
 .float spawnshieldtime;
-.float item_spawnshieldtime;
 
 .int playerid;
 .float noalign;                // if set to 1, the item or spawnpoint won't be dropped to the floor
@@ -164,11 +140,6 @@ float default_weapon_alpha;
 
 string gamemode_name;
 
-void FixIntermissionClient(entity e);
-void FixClientCvars(entity e);
-
-.float respawn_countdown; // next number to count
-
 float bot_waypoints_for_items;
 
 // speedrun: when 1, player auto teleports back when capture timeout happens
@@ -186,8 +157,6 @@ int have_team_spawns_forteams; // if Xth bit is 1 then team X has spawns else it
 
 .bool canteamdamage;
 
-void Damage (entity targ, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force);
-
 // WEAPONTODO
 #define DMG_NOWEP (weaponentities[0])
 
@@ -196,8 +165,6 @@ float sv_maxidle_spectatorsareidle;
 int sv_maxidle_slots;
 bool sv_maxidle_slots_countbots;
 
-float tracebox_hits_trigger_hurt(vector start, vector mi, vector ma, vector end);
-
 // autotaunt system
 .float cvar_cl_autotaunt;
 .float cvar_cl_voice_directional;
@@ -222,8 +189,6 @@ float cvar_purechanges_count;
 //float game_starttime; //point in time when the countdown to game start is over
 //float round_starttime; //point in time when the countdown to round start is over
 
-void W_Porto_Remove (entity p);
-
 .int projectiledeathtype;
 
 .string message2;
@@ -238,26 +203,11 @@ float g_nexball_meter_period;
 .void(entity this) reset; // if set, an entity is reset using this
 .void(entity this) reset2; // if set, an entity is reset using this (after calling ALL the reset functions for other entities)
 
-//vector debug_shotorg; // if non-zero, overrides the shot origin of all weapons
-
 .bool wasplayer;
 
-float servertime, serverprevtime, serverframetime;
-
-.float ammo_fuel;
-
-//flood fields
-.float nickspamtime; // time of last nick change
-.float nickspamcount;
-.float floodcontrol_chat;
-.float floodcontrol_chatteam;
-.float floodcontrol_chattell;
-.float floodcontrol_voice;
-.float floodcontrol_voiceteam;
-
 string matchid;
 
-bool radar_showennemies;
+bool radar_showenemies;
 
 .int minelayer_mines;
 .float vortex_charge;
@@ -295,8 +245,6 @@ const int FROZEN_NORMAL                             = 1;
 const int FROZEN_TEMP_REVIVING         = 2;
 const int FROZEN_TEMP_DYING                    = 3;
 
-.int active;
-.void (entity this, int act_state) setactive;
 .entity realowner;
 
 //float serverflags;
@@ -311,32 +259,12 @@ const int FROZEN_TEMP_DYING                       = 3;
 
 .float misc_bulletcounter;     // replaces uzi & hlac bullet counter.
 
-void PlayerUseKey(entity this);
-
-USING(spawn_evalfunc_t, vector(entity this, entity player, entity spot, vector current));
-.spawn_evalfunc_t spawn_evalfunc;
-
 string modname;
 
-.int missile_flags;
-const int MIF_SPLASH = BIT(1);
-const int MIF_ARC = BIT(2);
-const int MIF_PROXY = BIT(3);
-const int MIF_GUIDED_MANUAL = BIT(4);
-const int MIF_GUIDED_HEAT = BIT(5);
-const int MIF_GUIDED_LASER = BIT(6);
-const int MIF_GUIDED_AI = BIT(7);
-const int MIF_GUIDED_TAG = BIT(7);
-const int MIF_GUIDED_ALL = MIF_GUIDED_MANUAL | MIF_GUIDED_HEAT | MIF_GUIDED_LASER | MIF_GUIDED_AI | MIF_GUIDED_TAG;
-const int MIF_GUIDED_TRACKING = MIF_GUIDED_HEAT | MIF_GUIDED_LASER | MIF_GUIDED_AI | MIF_GUIDED_TAG;
-const int MIF_GUIDED_CONFUSABLE = MIF_GUIDED_HEAT | MIF_GUIDED_AI;
-
 ////
 
 .string cvar_cl_physics;
 
-.void(entity this, entity player) init_for_player;
-
 .WepSet dual_weapons;
 
 IntrusiveList g_monsters;
index 794b27ccc26b232c6fb2cfccc173c18d9ba79019..771bf216eebbc51f3641171af8e01f6b04e87055 100644 (file)
@@ -52,6 +52,8 @@ float damage_gooddamage;
 .bool istypefrag;
 .float taunt_soundtime;
 
+.int totalfrags;
+
 float IsFlying(entity a);
 
 void UpdateFrags(entity player, int f);
@@ -96,6 +98,11 @@ float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector in
 
 float RadiusDamage (entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, int deathtype, .entity weaponentity, entity directhitentity);
 
+.float damageforcescale;
+const float MIN_DAMAGEEXTRARADIUS = 2;
+const float MAX_DAMAGEEXTRARADIUS = 16;
+.float damageextraradius;
+
 // Calls .event_heal on the target so that they can handle healing themselves
 // a limit of RES_LIMIT_NONE should be handled by the entity as its max health (if applicable)
 bool Heal(entity targ, entity inflictor, float amount, float limit);
index 4894b272439319fd76fb9c528bf0df61296cab51..e1b4352078137b01642c157008c68c4b5d7513ad 100644 (file)
@@ -1,6 +1,7 @@
 #include "g_hook.qh"
 
 #include <server/defs.qh>
+#include <server/g_damage.qh>
 #include <server/miscfunctions.qh>
 #include <common/effects/all.qh>
 #include "weapons/common.qh"
index da950f18575e28a410fbed9955b90a0a5ced4ed7..6b9a9f8eca7b8860ea5458dd9f49468b9d9b1b89 100644 (file)
@@ -5,6 +5,9 @@ float checkrules_suddendeathwarning;
 float checkrules_suddendeathend;
 float checkrules_overtimesadded; //how many overtimes have been already added
 
+// flag set on worldspawn so that the code knows if it is dedicated or not
+bool server_is_dedicated;
+
 string cache_mutatormsg;
 string cache_lastmutatormsg;
 
index ee26d65a794056fb78d445ab327ca879214be60b..f066615f326b270e81b4e98b8161aeb4312c689a 100644 (file)
@@ -4,6 +4,7 @@
 #include "weapons/throwing.qh"
 #include "command/common.qh"
 #include "cheats.qh"
+#include "client.qh"
 #include "clientkill.qh"
 #include "weapons/selection.qh"
 #include "weapons/tracing.qh"
index d135ee387de44d6c1c3a73095c55aeac6e093abb..406f424fa34e9860e5ab1ce3bbbeb99a02ad8634 100644 (file)
@@ -18,6 +18,9 @@ const float ITEM_RESPAWN_TICKS = 10;
 
 .float item_respawncounter;
 
+// delay before this item can be picked up
+.float item_spawnshieldtime;
+
 void Item_Show (entity e, int mode);
 
 void Item_Respawn (entity this);
index e427483069522786f163c6ff9cf6908151c8e84f..8d747e254e5f8a9da7afa9043019e097c206f6e4 100644 (file)
@@ -1,5 +1,6 @@
 #include "mapvoting.qh"
 
+#include <server/client.qh>
 #include <server/defs.qh>
 #include <server/gamelog.qh>
 #include <server/miscfunctions.qh>
index 73b7329788ffb8618d4af231aa159cf0f98c18b4..84901fa32273fd54b7cf7640225ce2cba2a5b8f5 100644 (file)
@@ -4,6 +4,7 @@
 #include "command/common.qh"
 #include "constants.qh"
 #include "g_hook.qh"
+#include "g_world.qh"
 #include <server/gamelog.qh>
 #include "ipban.qh"
 #include <server/items/items.qh>
@@ -25,6 +26,7 @@
 #include "../common/playerstats.qh"
 #include "../common/teams.qh"
 #include "../common/mapobjects/subs.qh"
+#include <common/mapobjects/trigger/hurt.qh>
 #include "../common/util.qh"
 #include "../common/turrets/sv_turrets.qh"
 #include <common/weapons/_all.qh>
index 8a626642e03499e094658afd5f322f44baa054d0..4af7b4f8aaeb327f38f733796c0a653424a33bb1 100644 (file)
@@ -167,7 +167,7 @@ void player_anim(entity this)
                animbits |= ANIMSTATE_FROZEN;
        if(this.move_movetype == MOVETYPE_FOLLOW)
                animbits |= ANIMSTATE_FOLLOW;
-       if(this.crouch)
+       if(IS_DUCKED(this))
                animbits |= ANIMSTATE_DUCK;
        animdecide_setstate(this, animbits, false);
        animdecide_setimplicitstate(this, IS_ONGROUND(this));
index 0eb325699d8f05716456d332685ab665c21e7ec4..8ba789e7bcdf8d818c5d9bab40f935d4b6dbb8ab 100644 (file)
@@ -16,6 +16,7 @@
 #include "../lib/warpzone/common.qh"
 #include "../common/vehicles/vehicle.qh"
 #include "../common/vehicles/sv_vehicles.qh"
+#include <common/weapons/weapon/porto.qh>
 #include <server/player.qh>
 
 #define PORTALS_ARE_NOT_SOLID
index 43443a11ff445a20e0e45d448ae753d62e83a176..22cd21f2d520f2f02b6bbb98f174d2b55632a4a7 100644 (file)
@@ -1,6 +1,7 @@
 #include "race.qh"
 
 #include <server/defs.qh>
+#include <server/g_damage.qh>
 #include <server/miscfunctions.qh>
 #include "client.qh"
 #include "portals.qh"
index 12175bb764f036435c1f745c0ac2ddc12fe74777..d9cea92db92609eaa72432f03eebe91cee61ff6c 100644 (file)
@@ -2,6 +2,7 @@
 
 #include "command/common.qh"
 #include "defs.qh"
+#include "client.qh"
 #include <server/g_world.qh>
 #include <server/miscfunctions.qh>
 #include <server/mutators/_mod.qh>
index fe6adaebf2cc7fa7ab47c10a530da0b7e907edf8..1609201c2f1c3d601d361b2c39b451b64bf67e50 100644 (file)
@@ -13,3 +13,6 @@ entity Spawn_FilterOutBadSpots(entity this, entity firstspot, float mindist, flo
 entity SelectSpawnPoint(entity this, bool anypoint);
 spawnfunc(info_player_deathmatch);
 void spawnpoint_use(entity this, entity actor, entity trigger);
+
+USING(spawn_evalfunc_t, vector(entity this, entity player, entity spot, vector current));
+.spawn_evalfunc_t spawn_evalfunc;
index 46284fde2e51f134609dc067532d25428d8de487..a70228667587043fcd4ef62aed4afe48d1cd0a64 100644 (file)
@@ -7,6 +7,8 @@ float client_cefc_accumulator;
 float client_cefc_accumulatortime;
 #endif
 
+float servertime, serverprevtime, serverframetime;
+
 /*
 ==================
 main
index d6432d698658f270e9a60764d20f1b720c2cd3d7..ce41941c530e89e68605ad57ae5ca40887d0ee1c 100644 (file)
@@ -2,6 +2,7 @@
 
 #include "client.qh"
 #include <server/gamelog.qh>
+#include <server/g_damage.qh>
 #include "race.qh"
 #include "scores.qh"
 #include "scores_rules.qh"
index 1b4b179d2485d32f22fb06665f280f2014b3f22c..5839a425d151f00ebf2583ea16798689780a10f9 100644 (file)
@@ -7,3 +7,16 @@ void W_GiveWeapon (entity e, float wep);
 void W_PlayStrengthSound(entity player);
 float W_CheckProjectileDamage(entity inflictor, entity projowner, int deathtype, float exception);
 void W_PrepareExplosionByDamage(entity this, entity attacker, void(entity this) explode);
+
+.int missile_flags;
+const int MIF_SPLASH = BIT(1);
+const int MIF_ARC = BIT(2);
+const int MIF_PROXY = BIT(3);
+const int MIF_GUIDED_MANUAL = BIT(4);
+const int MIF_GUIDED_HEAT = BIT(5);
+const int MIF_GUIDED_LASER = BIT(6);
+const int MIF_GUIDED_AI = BIT(7);
+const int MIF_GUIDED_TAG = BIT(7);
+const int MIF_GUIDED_ALL = MIF_GUIDED_MANUAL | MIF_GUIDED_HEAT | MIF_GUIDED_LASER | MIF_GUIDED_AI | MIF_GUIDED_TAG;
+const int MIF_GUIDED_TRACKING = MIF_GUIDED_HEAT | MIF_GUIDED_LASER | MIF_GUIDED_AI | MIF_GUIDED_TAG;
+const int MIF_GUIDED_CONFUSABLE = MIF_GUIDED_HEAT | MIF_GUIDED_AI;