+#ifndef SERVER_DEFS_H
+#define SERVER_DEFS_H
+
+#include "../common/weapons/weapons.qh"
+
#define INDEPENDENT_ATTACK_FINISHED
noref float require_spawnfunc_prefix; // if this float exists, only functions with spawnfunc_ name prefix qualify as spawn functions
// Fields
-.void(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force) event_damage;
+.void(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force) event_damage;
//.string wad;
//.string map;
//.float cnt2;
.float play_time;
-.float respawn_flags;
+.int respawn_flags;
.float respawn_time;
.float respawn_time_max;
.float death_time;
.entity exteriorweaponentity;
.vector weaponentity_glowmod;
-//.float weapon; // current weapon
-.float switchweapon; // weapon requested to switch to
-.float switchingweapon; // weapon currently being switched to (is copied from switchweapon once switch is possible)
+//.int weapon; // current weapon
+.int switchweapon; // weapon requested to switch to
+.int switchingweapon; // weapon currently being switched to (is copied from switchweapon once switch is possible)
.string weaponname; // name of .weapon
// WEAPONTODO
// weapon states (self.weaponentity.state)
-const float WS_CLEAR = 0; // no weapon selected
-const float WS_RAISE = 1; // raise frame
-const float WS_DROP = 2; // deselecting frame
-const float WS_INUSE = 3; // fire state
-const float WS_READY = 4; // idle frame
+const int WS_CLEAR = 0; // no weapon selected
+const int WS_RAISE = 1; // raise frame
+const int WS_DROP = 2; // deselecting frame
+const int WS_INUSE = 3; // fire state
+const int WS_READY = 4; // idle frame
// there is 2 weapon tics that can run in one server frame
-const float W_TICSPERFRAME = 2;
+const int W_TICSPERFRAME = 2;
void weapon_defaultspawnfunc(float wpn);
.float version_nagtime;
-const float NUM_JUMPPADSUSED = 3;
+const int NUM_JUMPPADSUSED = 3;
.float jumppadcount;
.entity jumppadsused[NUM_JUMPPADSUSED];
.entity killindicator;
.float killindicator_teamchange;
-void Damage (entity targ, entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force);
+void Damage (entity targ, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force);
float lockteams;
float next_pingtime;
.float Version;
-.float SendFlags;
-.float(entity to, float sendflags) SendEntity;
+.int SendFlags;
+.bool(entity to, int sendflags) SendEntity;
// player sounds, voice messages
// TODO implemented fall and falling
string clientstuff;
.float phase;
-.float pressedkeys;
+.int pressedkeys;
.float porto_forbidden;
void W_Porto_Remove (entity p);
-.float projectiledeathtype;
+.int projectiledeathtype;
.string message2;
.float hit_time;
.float typehit_time;
-.float damage_dealt_total;
+.float damage_dealt_total;
.float stat_leadlimit;
-float radar_showennemies;
+bool radar_showennemies;
#ifdef PROFILING
float client_cefc_accumulator;
#endif
.float weapon_load[WEP_MAXCOUNT];
-.float ammo_none; // used by the reloading system, must always be 0
+.int ammo_none; // used by the reloading system, must always be 0
.float clip_load;
.float old_clip_load;
.float clip_size;
.float vortex_chargepool_ammo;
.float hagar_load;
-.float grab; // 0 = can't grab, 1 = owner can grab, 2 = owner and team mates can grab, 3 = anyone can grab
+.int grab; // 0 = can't grab, 1 = owner can grab, 2 = owner and team mates can grab, 3 = anyone can grab
#define PROJECTILE_MAKETRIGGER(e) (e).solid = SOLID_CORPSE; (e).dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE
// when doing this, hagar can go through clones
.void (float act_state) setactive;
.entity realowner;
-float serverflags;
+//float serverflags;
.float team_forced; // can be a team number to force a team, or 0 for default action, or -1 for forced spectator
string modname;
.float missile_flags;
-const float MIF_SPLASH = 2;
-const float MIF_ARC = 4;
-const float MIF_PROXY = 8;
-const float MIF_GUIDED_MANUAL = 16;
-const float MIF_GUIDED_HEAT = 32;
-const float MIF_GUIDED_LASER = 64;
-const float MIF_GUIDED_AI = 128;
-const float MIF_GUIDED_TAG = 128;
+const int MIF_SPLASH = 2;
+const int MIF_ARC = 4;
+const int MIF_PROXY = 8;
+const int MIF_GUIDED_MANUAL = 16;
+const int MIF_GUIDED_HEAT = 32;
+const int MIF_GUIDED_LASER = 64;
+const int MIF_GUIDED_AI = 128;
+const int MIF_GUIDED_TAG = 128;
#define MIF_GUIDED_ALL (MIF_GUIDED_MANUAL | MIF_GUIDED_HEAT | MIF_GUIDED_LASER | MIF_GUIDED_AI | MIF_GUIDED_TAG)
#define MIF_GUIDED_TRACKING (MIF_GUIDED_HEAT | MIF_GUIDED_LASER | MIF_GUIDED_AI | MIF_GUIDED_TAG)
#define MIF_GUIDED_CONFUSABLE (MIF_GUIDED_HEAT | MIF_GUIDED_AI)
.string playernick;
.float elos;
.float ranks;
+
+.float init_for_player_needed;
+.void(entity) init_for_player;
+
+#endif