]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/weapons/weaponsystem.qc
Merge branch 'master' into Mario/vehicles
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / weapons / weaponsystem.qc
index 1e589309ca2b6f0839344320857c9fe997812747..dbe97dbe38560fb6064346175d50cbeb2ad320b5 100644 (file)
@@ -1,24 +1,19 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../../dpdefs/progsdefs.qh"
-    #include "../../dpdefs/dpextensions.qh"
-    #include "../sys-post.qh"
-    #include "../../common/constants.qh"
-    #include "../../common/util.qh"
-    #include "../../common/animdecide.qh"
-    #include "../../common/monsters/monsters.qh"
-    #include "../../common/weapons/weapons.qh"
-    #include "weaponsystem.qh"
-    #include "../t_items.qh"
-    #include "../autocvars.qh"
-    #include "../defs.qh"
-    #include "../../common/notifications.qh"
-    #include "../mutators/mutators_include.qh"
-    #include "../command/common.qh"
-    #include "../../csqcmodellib/sv_model.qh"
-    #include "../round_handler.qh"
-#endif
+#include "weaponsystem.qh"
+#include "../_all.qh"
+
+#include "selection.qh"
+
+#include "../command/common.qh"
+#include "../mutators/mutators_include.qh"
+#include "../round_handler.qh"
+#include "../t_items.qh"
+#include "../../common/animdecide.qh"
+#include "../../common/constants.qh"
+#include "../../common/monsters/all.qh"
+#include "../../common/notifications.qh"
+#include "../../common/util.qh"
+#include "../../common/weapons/all.qh"
+#include "../../csqcmodellib/sv_model.qh"
 
 /*
 ===========================================================================
@@ -43,13 +38,6 @@ float W_WeaponRateFactor()
        return t;
 }
 
-// VorteX: static frame globals
-const float WFRAME_DONTCHANGE = -1;
-const float WFRAME_FIRE1 = 0;
-const float WFRAME_FIRE2 = 1;
-const float WFRAME_IDLE = 2;
-const float WFRAME_RELOAD = 3;
-.float wframe;
 
 void(float fr, float t, void() func) weapon_thinkf;
 
@@ -289,7 +277,7 @@ vector CL_Weapon_GetShotOrg(float wpn)
 
 void CL_Weaponentity_Think()
 {
-       float tb;
+       int tb;
        self.nextthink = time;
        if (intermission_running)
                self.frame = self.anim_idle.x;
@@ -653,17 +641,17 @@ void weapon_thinkf(float fr, float t, void() func)
        }
 }
 
-float forbidWeaponUse()
+float forbidWeaponUse(entity player)
 {
        if(time < game_starttime && !autocvar_sv_ready_restart_after_countdown)
                return 1;
        if(round_handler_IsActive() && !round_handler_IsRoundStarted())
                return 1;
-       if(self.player_blocked)
+       if(player.player_blocked)
                return 1;
-       if(self.frozen)
+       if(player.frozen)
                return 1;
-       if(self.weapon_blocked)
+       if(player.weapon_blocked)
                return 1;
        return 0;
 }
@@ -678,7 +666,7 @@ void W_WeaponFrame()
        if (!self.weaponentity || self.health < 1)
                return; // Dead player can't use weapons and injure impulse commands
 
-       if(forbidWeaponUse())
+       if(forbidWeaponUse(self))
        if(self.weaponentity.state != WS_CLEAR)
        {
                w_ready();
@@ -979,7 +967,6 @@ void W_Reload(float sent_ammo_min, string sent_sound)
        self.clip_load = self.(weapon_load[self.weapon]) = -1;
 }
 
-entity weapon_dropevent_item;
 void W_DropEvent(float event, entity player, float weapon_type, entity weapon_item)
 {
        entity oldself = self;