]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/defs.qh
Merge branch 'master' into terencehill/dynamic_hud
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / defs.qh
index 62fec55feee4890ecd8b100eaa9b51ebb38ff5af..65447c7d635bfd0e3472199faed7df509bb2897f 100644 (file)
@@ -1,28 +1,14 @@
-#ifndef SERVER_DEFS_H
-#define SERVER_DEFS_H
+#pragma once
 
-#include "../common/weapons/all.qh"
-#include "../common/stats.qh"
+float warmup_limit;
+#include <common/weapons/all.qh>
+#include <common/stats.qh>
 
 #define INDEPENDENT_ATTACK_FINISHED 1
 
-#define BUTTON_ATCK       button0
-#define BUTTON_JUMP       button2
-#define BUTTON_ATCK2      button3
-#define BUTTON_ZOOM       button4
-#define BUTTON_CROUCH     button5
-#define BUTTON_HOOK       button6
-#define BUTTON_INFO       button7
-#define BUTTON_CHAT       buttonchat
-#define BUTTON_USE        buttonuse
-#define BUTTON_DRAG       button8
-#define BUTTON_ZOOMSCRIPT button9
-#define BUTTON_JETPACK    button10
-
 // Globals
 
 float g_footsteps, g_grappling_hook, g_instagib;
-float g_warmup_limit;
 float g_warmup_allguns;
 float g_warmup_allow_timeout;
 float warmup_stage;
@@ -59,7 +45,7 @@ float server_is_dedicated;
 
 // Fields
 
-.void(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force) event_damage;
+.void(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force) event_damage;
 
 //.string      wad;
 //.string      map;
@@ -103,6 +89,7 @@ void() player_setupanimsformodel;
 .float scheduledrespawntime;
 .float respawntime;
 .float respawntimejitter;
+.float respawntimestart;
 //.float       chasecam;
 
 .float damageforcescale;
@@ -129,7 +116,6 @@ const float MAX_DAMAGEEXTRARADIUS = 16;
 .float iscreature;
 .float damagedbycontents;
 .float damagedbytriggers;
-.float pushable;
 .float teleportable;
 .vector oldvelocity;
 
@@ -144,7 +130,7 @@ const float MAX_DAMAGEEXTRARADIUS = 16;
 
 // WEAPONTODO
 .float autoswitch;
-float client_hasweapon(entity cl, float wpn, float andammo, float complain);
+bool client_hasweapon(entity cl, Weapon wpn, float andammo, bool complain);
 void w_clear(Weapon thiswep, entity actor, .entity weaponentity, int fire);
 void w_ready(Weapon thiswep, entity actor, .entity weaponentity, int fire);
 // VorteX: standalone think for weapons, so normal think on weaponentity can be reserved by weaponflashes (which needs update even player dies)
@@ -177,7 +163,7 @@ float game_completion_ratio; // 0 at start, 1 near end
 .float alivetime; // time of being alive
 .float motd_actived_time; // used for both motd and campaign_message
 
-float nJoinAllowed(entity ignore);
+bool nJoinAllowed(entity this, entity ignore);
 
 .float spawnshieldtime;
 .float item_spawnshieldtime;
@@ -185,7 +171,6 @@ float nJoinAllowed(entity ignore);
 .entity flagcarried;
 
 .int playerid;
-float playerid_last;
 .float noalign;                // if set to 1, the item or spawnpoint won't be dropped to the floor
 
 .vector death_origin;
@@ -205,7 +190,6 @@ float default_weapon_alpha;
 .string cvar_g_xonoticversion;
 .string cvar_cl_weaponpriority;
 .string cvar_cl_weaponpriorities[10];
-.float cvar_cl_gunalign;
 .float cvar_cl_noantilag;
 
 .string weaponorder_byimpulse;
@@ -242,7 +226,7 @@ float bot_waypoints_for_items;
 #else
 #define ATTACK_FINISHED_FOR(ent, w, slot) ((ent).attack_finished_single[slot])
 #endif
-#define ATTACK_FINISHED(ent, slot) ATTACK_FINISHED_FOR(ent, (ent).weapon, slot)
+#define ATTACK_FINISHED(ent, slot) ATTACK_FINISHED_FOR(ent, PS(ent).m_weapon.m_id, slot)
 
 // assault game mode: Which team is attacking in this round?
 float assault_attacker_team;
@@ -394,7 +378,7 @@ float client_cefc_accumulatortime;
 
 string deathmessage;
 
-.float just_joined;
+.bool just_joined;
 
 .float cvar_cl_weaponimpulsemode;
 .float selectweapon; // last selected weapon of the player
@@ -431,7 +415,7 @@ const float ACTIVE_TOGGLE   = 3;
 
 void PlayerUseKey();
 
-typedef vector(entity player, entity spot, vector current) spawn_evalfunc_t;
+USING(spawn_evalfunc_t, vector(entity player, entity spot, vector current));
 .spawn_evalfunc_t spawn_evalfunc;
 
 string modname;
@@ -466,5 +450,3 @@ const int MIF_GUIDED_CONFUSABLE = MIF_GUIDED_HEAT | MIF_GUIDED_AI;
 
 .float init_for_player_needed;
 .void(entity) init_for_player;
-
-#endif