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 388d1a9..319784a 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 a7aa279..4ef6b2f 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 9a9a654..8c17555 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 9166f4f..bf0db40 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 735b01b..0066af4 100644 (file)
@@ -2,6 +2,7 @@
 
 #include <common/effects/all.qh>
 #include <server/gamelog.qh>
+#include <server/g_damage.qh>
 
 .entity ballcarried;
 
index 079b181..cd73ea5 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 2941564..35a7d95 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 f65a9c2..40af525 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 8d2e98d..e1fb909 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 e992154..66f7568 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 73113b4..513ff12 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 136f3c4..611321c 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 2243c98..5c75056 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 d6db436..c8fb372 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 2fd66af..76bfb03 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 fc11cfa..4efb16f 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 4b852d5..e72b625 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 64b5e20..ef7b60c 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 f03e9dc..066066f 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 da2660b..3bc2258 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 29820ef..6c1a6e7 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 92948dc..af708da 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 fa4af04..7637424 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 81baa2c..6c3d314 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 bcf02da..90ef1e2 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 2961145..d388b15 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 26d69ab..4b65a69 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 eda0838..9167ca5 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 c0d3898..0458b07 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 328726d..2ad2d8f 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 32ccd88..c9e8b59 100644 (file)
@@ -1,5 +1,6 @@
 #include "common.qh"
 
+#include <server/client.qh>
 #include <server/defs.qh>
 #include <server/miscfunctions.qh>
 
index 3d1e614..7b8e063 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 794b27c..771bf21 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 4894b27..e1b4352 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 da950f1..6b9a9f8 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 ee26d65..f066615 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 d135ee3..406f424 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 e427483..8d747e2 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 73b7329..84901fa 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 8a62664..4af7b4f 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 0eb3256..8ba789e 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 43443a1..22cd21f 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 12175bb..d9cea92 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 fe6adae..1609201 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 46284fd..a702286 100644 (file)
@@ -7,6 +7,8 @@ float client_cefc_accumulator;
 float client_cefc_accumulatortime;
 #endif
 
+float servertime, serverprevtime, serverframetime;
+
 /*
 ==================
 main
index d6432d6..ce41941 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 1b4b179..5839a42 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;