#include "../warpzonelib/mathlib.qh"
.float death_time;
- .float modelflags;
+ .int modelflags;
#elif defined(MENUQC)
#elif defined(SVQC)
#endif
// Weapon icons (#0)
//
entity weaponorder[WEP_MAXCOUNT];
-void weaponorder_swap(float i, float j, entity pass)
+void weaponorder_swap(int i, int j, entity pass)
{
- entity h;
- h = weaponorder[i];
+ entity h = weaponorder[i];
weaponorder[i] = weaponorder[j];
weaponorder[j] = h;
}
// figure out weapon order (how the weapons are sorted) // TODO make this configurable
if(weaponorder_bypriority != autocvar_cl_weaponpriority || !weaponorder[0])
{
- float weapon_cnt;
+ int weapon_cnt;
if(weaponorder_bypriority)
strunzone(weaponorder_bypriority);
if(weaponorder_byimpulse)
HUD_Panel_GetBorder(); \
} while(0)
-const float NOTIFY_MAX_ENTRIES = 10;
-const float NOTIFY_ICON_MARGIN = 0.02;
+const int NOTIFY_MAX_ENTRIES = 10;
+const int NOTIFY_ICON_MARGIN = 0.02;
int notify_index;
int notify_count;
float hud_field_icon2_alpha;
string HUD_GetField(entity pl, int field)
{
- float tmp, num, denom, f;
+ float tmp, num, denom;
+ int f;
string str;
hud_field_rgb = '1 1 1';
hud_field_icon0 = "";
vector tmp, rgb;
rgb = Team_ColorRGB(pl.team);
string str;
- float field;
+ int field;
float is_spec;
is_spec = (GetPlayerColor(pl.sv_entnum) == NUM_SPECTATOR);
vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size)
{
int i;
- float weapon_cnt = WEP_COUNT - 3; // either vaporizer/vortex are hidden, no port-o-launch, no tuba
+ int weapon_cnt = WEP_COUNT - 3; // either vaporizer/vortex are hidden, no port-o-launch, no tuba
float rows;
if(autocvar_scoreboard_accuracy_doublerows)
rows = 2;
if(autocvar_hud_shownames_crosshairdistance > crosshairdistance)
ent.pointtime = time;
- if (!(ent.pointtime + autocvar_hud_shownames_crosshairdistance_time > time))
+ if (ent.pointtime + autocvar_hud_shownames_crosshairdistance_time <= time)
overlap = true;
else
overlap = (autocvar_hud_shownames_crosshairdistance_antioverlap ? overlap : false); // override what antioverlap says unless allowed by cvar.
void Net_TargetMusic()
{
- float vol, fai, fao, tim, id;
- string noi;
- entity e;
-
- id = ReadShort();
- vol = ReadByte() / 255.0;
- fai = ReadByte() / 16.0;
- fao = ReadByte() / 16.0;
- tim = ReadByte();
- noi = ReadString();
+ int id = ReadShort();
+ float vol = ReadByte() / 255.0;
+ float fai = ReadByte() / 16.0;
+ float fao = ReadByte() / 16.0;
+ float tim = ReadByte();
+ string noi = ReadString();
+ entity e;
for(e = world; (e = findfloat(e, enttype, ENT_CLIENT_TRIGGER_MUSIC)); )
{
if(e.count == id)
if(sf & TNSF_STATUS)
{
- float _tmp;
- _tmp = ReadByte();
+ int _tmp = ReadByte();
if(_tmp != self.team)
{
self.team = _tmp;
}
}
-const float BUTTON_3 = 4;
-const float BUTTON_4 = 8;
+const int BUTTON_3 = 4;
+const int BUTTON_4 = 8;
float cl_notice_run();
float prev_myteam;
void CSQC_UpdateView(float w, float h)
}
}
-void animdecide_setstate(entity e, float newstate, float restart)
+void animdecide_setstate(entity e, int newstate, float restart)
{
if(!restart)
if(newstate == e.anim_state)
.float anim_upper_implicit_time;
// explicit anim states (networked)
-void animdecide_setstate(entity e, float newstate, float restart);
+void animdecide_setstate(entity e, int newstate, float restart);
const int ANIMSTATE_DEAD1 = 1; // base frames: die1
const int ANIMSTATE_DEAD2 = 2; // base frames: die2
const int ANIMSTATE_DUCK = 4; // turns walk into duckwalk, jump into duckjump, etc.
#include "buffs.qh"
#endif
-vector Buff_Color(float buff_id)
+vector Buff_Color(int buff_id)
{
entity e;
for(e = Buff_Type_first; e; e = e.enemy)
return '1 1 1';
}
-string Buff_PrettyName(float buff_id)
+string Buff_PrettyName(int buff_id)
{
entity e;
for(e = Buff_Type_first; e; e = e.enemy)
return "";
}
-string Buff_Name(float buff_id)
+string Buff_Name(int buff_id)
{
entity e;
for(e = Buff_Type_first; e; e = e.enemy)
return "";
}
-float Buff_Type_FromName(string buff_name)
+int Buff_Type_FromName(string buff_name)
{
entity e;
for(e = Buff_Type_first; e; e = e.enemy)
return 0;
}
-float Buff_Type_FromSprite(string buff_sprite)
+int Buff_Type_FromSprite(string buff_sprite)
{
entity e;
for(e = Buff_Type_first; e; e = e.enemy)
}
-float Buff_Skin(float buff_id)
+int Buff_Skin(float buff_id)
{
entity e;
for(e = Buff_Type_first; e; e = e.enemy)
return 0;
}
-string Buff_Sprite(float buff_id)
+string Buff_Sprite(int buff_id)
{
entity e;
for(e = Buff_Type_first; e; e = e.enemy)
entity Buff_Type_last;
.entity enemy; // internal next pointer
-float BUFF_LAST = 1;
+int BUFF_LAST = 1;
.int items; // buff ID
.string netname; // buff name
.string message; // human readable name
.vector colormod; // buff color
.string model2; // buff sprite
-.float skin; // buff skin
+.int skin; // buff skin
#define REGISTER_BUFF(hname,sname,NAME,bskin,bcolor) \
- float BUFF_##NAME; \
+ int BUFF_##NAME; \
entity Buff_Type##sname; \
void RegisterBuffs_##sname() \
{ \
#undef REGISTER_BUFF
#ifdef SVQC
-.float buffs;
+.int buffs;
void buff_Init(entity ent);
-void buff_Init_Compat(entity ent, float replacement);
+void buff_Init_Compat(entity ent, int replacement);
#define BUFF_SPAWNFUNC(e,b,t) void spawnfunc_item_buff_##e() { self.buffs = b; self.team = t; buff_Init(self); }
#define BUFF_SPAWNFUNC_Q3TA_COMPAT(o,r) void spawnfunc_item_##o() { buff_Init_Compat(self,r); }
BUFF_SPAWNFUNC_Q3TA_COMPAT(medic, BUFF_MEDIC)
#endif
-vector Buff_Color(float buff_id);
-string Buff_PrettyName(float buff_id);
-string Buff_Name(float buff_id);
-float Buff_Type_FromName(string buff_name);
-float Buff_Type_FromSprite(string buff_sprite);
-float Buff_Skin(float buff_id);
-string Buff_Sprite(float buff_id);
+vector Buff_Color(int buff_id);
+string Buff_PrettyName(int buff_id);
+string Buff_Name(int buff_id);
+int Buff_Type_FromName(string buff_name);
+int Buff_Type_FromSprite(string buff_sprite);
+int Buff_Skin(int buff_id);
+string Buff_Sprite(int buff_id);
#endif
\ No newline at end of file
#endif
// each i-th array element corresponds to the list entry campaign_offset+i
-float campaign_entries;
-float campaign_offset;
+int campaign_entries;
+int campaign_offset;
string campaign_gametype[CAMPAIGN_MAX_ENTRIES];
string campaign_mapname[CAMPAIGN_MAX_ENTRIES];
float campaign_bots[CAMPAIGN_MAX_ENTRIES];
void CampaignFile_Unload()
{
- float i;
if(campaign_title)
{
strunzone(campaign_title);
+ int i;
for(i = 0; i < campaign_entries; ++i)
{
strunzone(campaign_gametype[i]);
#include "mapinfo.qh"
#endif
-void CampaignSetup(float n)
+void CampaignSetup(int n)
{
localcmd("set g_campaign 1\n");
localcmd("set _campaign_name \"");
#define DEATH_WEAPONOF(t) (DEATH_ISSPECIAL(t) ? 0 : DEATH_WEAPONOFWEAPONDEATH(t))
#define WEP_VALID(w) ((w) >= WEP_FIRST && (w) <= WEP_LAST)
-string Deathtype_Name(float deathtype)
+string Deathtype_Name(int deathtype)
{
if(DEATH_ISSPECIAL(deathtype))
{
// generic string stuff
-float _MapInfo_Cache_Active;
-float _MapInfo_Cache_DB_NameToIndex;
-float _MapInfo_Cache_Buf_IndexToMapData;
+int _MapInfo_Cache_Active;
+int _MapInfo_Cache_DB_NameToIndex;
+int _MapInfo_Cache_Buf_IndexToMapData;
void MapInfo_Cache_Destroy()
{
return MapInfo_FindName_match;
}
-float MapInfo_CurrentFeatures()
+int MapInfo_CurrentFeatures()
{
int req = 0;
if(!(cvar("g_lms") || cvar("g_instagib") || cvar("g_overkill") || cvar("g_nix") || cvar("g_weaponarena") || !cvar("g_pickup_items") || cvar("g_race") || cvar("g_cts") || cvar("g_nexball")))
return req;
}
-float MapInfo_CurrentGametype()
+int MapInfo_CurrentGametype()
{
entity e;
int prev = cvar("gamecfg");
#ifndef MAPINFO_H
#define MAPINFO_H
-float MAPINFO_TYPE_ALL;
+int MAPINFO_TYPE_ALL;
entity MapInfo_Type_first;
entity MapInfo_Type_last;
.entity enemy; // internal next pointer
-.float items; // game type ID
+.int items; // game type ID
.string netname; // game type name as in cvar (with g_ prefix)
.string mdl; // game type short name
.string message; // human readable name
return 1;
}
-.float skin_for_monstersound;
+.int skin_for_monstersound;
void UpdateMonsterSounds()
{
entity mon = get_monsterinfo(self.monsterid);
#ifdef SVQC
-float healer_send(entity to, float sf)
+float healer_send(entity to, int sf)
{
WriteByte(MSG_ENTITY, ENT_CLIENT_HEALING_ORB);
WriteByte(MSG_ENTITY, sf);
int typeId,
int nameid,
string namestring,
- float strnum,
- float flnum,
+ int strnum,
+ int flnum,
/* MSG_ANNCE */
float channel,
string snd,
void Local_Notification_centerprint_generic(
string input, string durcnt,
- float cpid, float f1, float f2)
+ int cpid, float f1, float f2)
{
string selected;
float sel_num;
}
#endif
-void Local_Notification(float net_type, float net_name, ...count)
+void Local_Notification(int net_type, int net_name, ...count)
{
// check if this should be aborted
if(net_name == NOTIF_ABORT)
float typeId,
float nameid,
string namestring,
- float strnum,
- float flnum,
+ int strnum,
+ int flnum,
/* MSG_ANNCE */
float channel,
string snd,
void Debug_Notification(string input);
#endif
-void Local_Notification(float net_type, float net_name, ...count);
+void Local_Notification(int net_type, int net_name, ...count);
void Local_Notification_WOVA(
float net_type, float net_name,
float stringcount, float floatcount,
#define MSG_MULTI_NOTIF(default,name,anncename,infoname,centername) \
NOTIF_ADD_AUTOCVAR(name, default) \
- float name; \
+ int name; \
void RegisterNotification_##name() \
{ \
SET_FIELD_COUNT(name, NOTIF_FIRST, NOTIF_MULTI_COUNT) \
void PlayerStats_GameReport_Accuracy(entity p)
{
- entity w;
- float i;
+ int i;
for(i = WEP_FIRST; i <= WEP_LAST; ++i)
{
- w = get_weaponinfo(i);
+ entity w = get_weaponinfo(i);
#define ACCMAC(suffix,field) \
PS_GR_P_ADDVAL(p, sprintf("acc-%s-%s", w.netname, suffix), p.accuracy.(field[i-1]));
#ifdef SVQC
//float PS_PM_IN_DB = -1; // playerstats_prematch_in_db // db for info COLLECTED at the beginning of a match
-float PS_GR_OUT_DB = -1; // playerstats_gamereport_out_db // db of info SENT at the end of a match
+int PS_GR_OUT_DB = -1; // playerstats_gamereport_out_db // db of info SENT at the end of a match
//float PS_GR_IN_DB = -1; // playerstats_gamereport_in_db // db for info COLLECTED at the end of a match
-float PS_B_IN_DB = -1; // playerstats_playerbasic_in_db // db for info COLLECTED for basic player info (ELO)
+int PS_B_IN_DB = -1; // playerstats_playerbasic_in_db // db for info COLLECTED for basic player info (ELO)
#endif
#ifdef MENUQC
-float PS_D_IN_DB = -1; // playerstats_playerdetail_in_db // db for info COLLECTED for detailed player profile display
+int PS_D_IN_DB = -1; // playerstats_playerdetail_in_db // db for info COLLECTED for detailed player profile display
#endif
#ifdef SVQC
.entity url_ready_pass;
// for multi handles
-.float url_attempt;
-.float url_mode;
+.int url_attempt;
+.int url_mode;
entity url_fromid[NUM_URL_ID];
-float autocvar__urllib_nextslot;
+int autocvar__urllib_nextslot;
-float url_URI_Get_Callback(float id, float status, string data)
+float url_URI_Get_Callback(int id, float status, string data)
{
if(id < MIN_URL_ID)
return 0;
}
}
-void url_single_fopen(string url, float mode, url_ready_func rdy, entity pass)
+void url_single_fopen(string url, int mode, url_ready_func rdy, entity pass)
{
entity e;
int i;
}
me.url_ready(fh, me.url_ready_pass, status);
}
-void url_multi_fopen(string url, float mode, url_ready_func rdy, entity pass)
+void url_multi_fopen(string url, int mode, url_ready_func rdy, entity pass)
{
float n;
n = tokenize_console(url);
void url_fputs(entity e, string s);
// returns true if handled
-float url_URI_Get_Callback(float id, float status, string data);
+float url_URI_Get_Callback(int id, float status, string data);
#define MIN_URL_ID URI_GET_URLLIB
#define NUM_URL_ID (URI_GET_URLLIB_END - URI_GET_URLLIB + 1)
return buf_create();
}
-float db_load(string pFilename)
+int db_load(string pFilename)
{
float db, fh, i, j, n;
string l;
}
// Multiline text file buffers
-float buf_load(string pFilename)
+int buf_load(string pFilename)
{
float buf, fh, i;
string l;
#ifdef CSQC
int ReadInt24_t()
{
- float v;
- v = ReadShort() * 256; // note: this is signed
+ int v = ReadShort() * 256; // note: this is signed
v += ReadByte(); // note: this is unsigned
return v;
}
#ifdef CSQC
entity ReadCSQCEntity()
{
- float f;
- f = ReadShort();
+ int f = ReadShort();
if(f == 0)
return world;
return findfloat(world, entnum, f);
// Balance Config Generator
// ==========================
-void W_Config_Queue_Swap(float root, float child, entity pass)
+void W_Config_Queue_Swap(int root, int child, entity pass)
{
string oldroot = wep_config_queue[root];
wep_config_queue[root] = wep_config_queue[child];
wep_config_queue[child] = oldroot;
}
-float W_Config_Queue_Compare(float root, float child, entity pass)
+float W_Config_Queue_Compare(int root, int child, entity pass)
{
return strcmp(wep_config_queue[root], wep_config_queue[child]);
}
void Dump_Weapon_Settings(void)
{
- float i, x, totalsettings = 0;
+ int i, x, totalsettings = 0;
for(i = WEP_FIRST; i <= WEP_LAST; ++i)
{
// step 1: clear the queue
}
#ifdef CSQC
-.float GetAmmoFieldFromNum(float i)
+.float GetAmmoFieldFromNum(int i)
{
switch(i)
{
}
}
-float GetAmmoStat(.float ammotype)
+int GetAmmoStat(.float ammotype)
{
switch(ammotype)
{
string GetAmmoPicture(.float ammotype);
#ifdef CSQC
-.float GetAmmoFieldFromNum(float i);
-float GetAmmoStat(.float ammotype);
+.float GetAmmoFieldFromNum(int i);
+int GetAmmoStat(.float ammotype);
#endif
// ammo types
// entity properties of weaponinfo:
// fields which are explicitly/manually set are marked with "M", fields set automatically are marked with "A"
-.float weapon; // M: WEP_id // WEP_...
+.int weapon; // M: WEP_id // WEP_...
.WepSet weapons; // A: WEPSET_id // WEPSET_...
.float(float) weapon_func; // M: function // w_...
..float ammo_field; // M: ammotype // main ammo field
.int impulse; // M: impulse // weapon impulse
-.float spawnflags; // M: flags // WEPSPAWNFLAG_... combined
+.int spawnflags; // M: flags // WEPSPAWNFLAG_... combined
.float bot_pickupbasevalue; // M: rating // bot weapon priority
.vector wpcolor; // M: color // waypointsprite color
.string wpmodel; // A: wpn-id // wpn- sprite name
// note: the fabs call is just there to hide "if result is constant" warning
#define REGISTER_WEAPON_2(id,bit,function,ammotype,impulse,flags,rating,color,modelname,simplemdl,crosshair,wepimg,refname,wepname) \
- float id; \
+ int id; \
WepSet bit; \
float function(float); \
void RegisterWeapons_##id() \
self.csqcmodel_teleported = 0;
}
-void CSQCModel_Read(float isnew)
+void CSQCModel_Read(bool isnew)
{
int sf = ReadInt24_t();
#include "common.qh"
-void CSQCModel_Read(float isnew);
+void CSQCModel_Read(bool isnew);
#define CSQCMODEL_IF(cond)
#define CSQCMODEL_ENDIF
float pmove_onground; // weird engine flag we shouldn't really use but have to for now
vector csqcplayer_origin, csqcplayer_velocity;
-float csqcplayer_sequence, player_pmflags;
+float csqcplayer_sequence;
+int player_pmflags;
float csqcplayer_moveframe;
vector csqcplayer_predictionerroro;
vector csqcplayer_predictionerrorv;
// generic CSQC model code
-float CSQCModel_Send(entity to, float sf)
+float CSQCModel_Send(entity to, int sf)
{
// some nice flags for CSQCMODEL_IF
float isplayer = (IS_CLIENT(self));
float(float number, float quantity) bitshift = #218;
//float(string str, string sub[, float startpos]) strstrofs = #221;
-float(string str, string sub, float startpos) strstrofs = #221;
-float(string str, float ofs) str2chr = #222;
-string(float c, ...) chr2str = #223;
+int(string str, string sub, float startpos) strstrofs = #221;
+int(string str, float ofs) str2chr = #222;
+string(int c, ...) chr2str = #223;
string(float ccase, float calpha, float cnum, string s, ...) strconv = #224;
string(float chars, string s, ...) strpad = #225;
string(string info, string key, string value, ...) infoadd = #226;
string(string info, string key) infoget = #227;
-float(string s1, string s2) strcmp = #228;
-float(string s1, string s2, float len) strncmp = #228;
-float(string s1, string s2) strcasecmp = #229;
-float(string s1, string s2, float len) strncasecmp = #230;
+int(string s1, string s2) strcmp = #228;
+int(string s1, string s2, float len) strncmp = #228;
+int(string s1, string s2) strcasecmp = #229;
+int(string s1, string s2, float len) strncasecmp = #230;
// CSQC range #300-#399
void() clearscene = #300;
float(float skel, entity ent, float modlindex, float retainfrac, float firstbone, float lastbone) skel_build = #264; // blend in a percentage of standard animation, 0 replaces entirely, 1 does nothing, 0.5 blends half, etc, and this only alters the bones in the specified range for which out of bounds values like 0,100000 are safe (uses .frame, .frame2, .frame3, .frame4, .lerpfrac, .lerpfrac3, .lerpfrac4, .frame1time, .frame2time, .frame3time, .frame4time), returns skel on success, 0 on failure
float(float skel) skel_get_numbones = #265; // returns how many bones exist in the created skeleton, 0 if skeleton does not exist
string(float skel, float bonenum) skel_get_bonename = #266; // returns name of bone (as a tempstring), "" if invalid bonenum (< 1 for example) or skeleton does not exist
-float(float skel, float bonenum) skel_get_boneparent = #267; // returns parent num for supplied bonenum, 0 if bonenum has no parent or bone does not exist (returned value is always less than bonenum, you can loop on this)
-float(float skel, string tagname) skel_find_bone = #268; // get number of bone with specified name, 0 on failure, bonenum (1-based) on success, same as using gettagindex but takes modelindex instead of entity
+int(float skel, float bonenum) skel_get_boneparent = #267; // returns parent num for supplied bonenum, 0 if bonenum has no parent or bone does not exist (returned value is always less than bonenum, you can loop on this)
+int(float skel, string tagname) skel_find_bone = #268; // get number of bone with specified name, 0 on failure, bonenum (1-based) on success, same as using gettagindex but takes modelindex instead of entity
vector(float skel, float bonenum) skel_get_bonerel = #269; // get matrix of bone in skeleton relative to its parent - sets v_forward, v_right, v_up, returns origin (relative to parent bone)
vector(float skel, float bonenum) skel_get_boneabs = #270; // get matrix of bone in skeleton in model space - sets v_forward, v_right, v_up, returns origin (relative to entity)
void(float skel, float bonenum, vector org) skel_set_bone = #271; // set matrix of bone relative to its parent, reads v_forward, v_right, v_up, takes origin as parameter (relative to parent bone)
//idea: LordHavoc
//darkplaces implementation: LordHavoc
//effects bit:
-float EF_ADDITIVE = 32;
+const int EF_ADDITIVE = 32;
//description:
//additive blending when this object is rendered
//idea: id Software
//darkplaces implementation: LordHavoc
//effects bit:
-float EF_BLUE = 64;
+const int EF_BLUE = 64;
//description:
//entity emits blue light (used for quad)
//idea: LordHavoc
//darkplaces implementation: [515] and LordHavoc
//effects bit:
-float EF_DOUBLESIDED = 32768;
+const int EF_DOUBLESIDED = 32768;
//description:
//render entity as double sided (backfaces are visible, I.E. you see the 'interior' of the model, rather than just the front), can be occasionally useful on transparent stuff.
//idea: C.Brutail, divVerent, maikmerten
//darkplaces implementation: divVerent
//effects bit:
-float EF_DYNAMICMODELLIGHT = 131072;
+const int EF_DYNAMICMODELLIGHT = 131072;
//description:
//force dynamic model light on the entity, even if it's a BSP model (or anything else with lightmaps or light colors)
//idea: LordHavoc
//darkplaces implementation: LordHavoc
//effects bit:
-float EF_FLAME = 1024;
+const int EF_FLAME = 1024;
//description:
//entity is on fire
//idea: LordHavoc
//darkplaces implementation: LordHavoc
//effects bit:
-float EF_FULLBRIGHT = 512;
+const int EF_FULLBRIGHT = 512;
//description:
//entity is always brightly lit
//idea: Supa
//darkplaces implementation: LordHavoc
//effects bit:
-float EF_NODEPTHTEST = 8192;
+const int EF_NODEPTHTEST = 8192;
//description:
//makes entity show up to client even through walls, useful with EF_ADDITIVE for special indicators like where team bases are in a map, so that people don't get lost
//idea: id Software
//darkplaces implementation: LordHavoc
//effects bit:
-float EF_NODRAW = 16;
+const int EF_NODRAW = 16;
//description:
//prevents server from sending entity to client (forced invisible, even if it would have been a light source or other such things)
//idea: Chris Page, Dresk
//darkplaces implementation: LordHAvoc
//effects bit:
-float EF_NOGUNBOB = 256;
+const int EF_NOGUNBOB = 256;
//description:
//this has different meanings depending on the entity it is used on:
//player entity - prevents gun bobbing on player.viewmodel
//idea: LordHavoc
//darkplaces implementation: LordHavoc
//effects bit:
-float EF_NOSHADOW = 4096;
+const int EF_NOSHADOW = 4096;
//description:
//realtime lights will not cast shadows from this entity (but can still illuminate it)
//idea: id Software
//darkplaces implementation: LordHavoc
//effects bit:
-float EF_RED = 128;
+const int EF_RED = 128;
//description:
//entity emits red light (used for invulnerability)
//idea: id software
//darkplaces implementation: divVerent
//effects bit:
-float EF_RESTARTANIM_BIT = 1048576;
+const int EF_RESTARTANIM_BIT = 1048576;
//description:
//when toggled, the current animation is restarted. Useful for weapon animation.
//to toggle this bit in QC, you can do:
//idea: MythWorks Inc
//darkplaces implementation: LordHavoc
//effects bit:
-float EF_STARDUST = 2048;
+const int EF_STARDUST = 2048;
//description:
//entity emits bouncing sparkles in every direction
//idea: id software
//darkplaces implementation: divVerent
//effects bit:
-float EF_TELEPORT_BIT = 2097152;
+const int EF_TELEPORT_BIT = 2097152;
//description:
//when toggled, interpolation of the entity is skipped for one frame. Useful for teleporting.
//to toggle this bit in QC, you can do:
//idea: VorteX, LordHavoc
//DarkPlaces implementation: VorteX
//builtin definitions:
-float(entity ent, string tagname) gettagindex = #451;
+int(entity ent, string tagname) gettagindex = #451;
vector(entity ent, float tagindex) gettaginfo = #452;
//description:
//gettagindex returns the number of a tag on an entity, this number is the same as set by setattachment (in the .tag_index field), allowing the qc to save a little cpu time by keeping the number around if it wishes (this could already be done by calling setattachment and saving off the tag_index).
//idea: Electro, SavageX, LordHavoc
//darkplaces implementation: LordHavoc
//builtin definitions:
-float(string s, string separator1, ...) tokenizebyseparator = #479;
+int(string s, string separator1, ...) tokenizebyseparator = #479;
//description:
//this function returns tokens separated by any of the supplied separator strings, example:
//numnumbers = tokenizebyseparator("10.2.3.4", ".");
//idea: divVerent
//darkplaces implementation: divVerent
//builtin definitions:
-float(string s) tokenize_console = #514;
-float(float i) argv_start_index = #515;
-float(float i) argv_end_index = #516;
+int(string s) tokenize_console = #514;
+int(float i) argv_start_index = #515;
+int(float i) argv_end_index = #516;
//description:
//this function returns tokens separated just like the console does
//also, functions are provided to get the index of the first and last character of each token in the original string
//idea: LordHavoc, Dresk
//darkplaces implementation: LordHavoc
//field definitions:
-.float modelflags;
+.int modelflags;
//constant definitions:
float EF_NOMODELFLAGS = 8388608; // ignore any effects in a model file and substitute your own
float MF_ROCKET = 1; // leave a trail
//idea: Spike
//darkplaces implementation: LordHavoc
//function definitions:
-float(string effectname) particleeffectnum = #335; // same as in CSQC
+int(string effectname) particleeffectnum = #335; // same as in CSQC
void(entity ent, float effectnum, vector start, vector end) trailparticles = #336; // same as in CSQC
void(float effectnum, vector org, vector vel, float howmany) pointparticles = #337; // same as in CSQC
//SVC definitions:
void(float fhandle) fclose = #111; // closes a file
string(float fhandle) fgets = #112; // reads a line of text from the file and returns as a tempstring
void(float fhandle, string s, ...) fputs = #113; // writes a line of text to the end of the file
-float(string s) strlen = #114; // returns how many characters are in a string
+int(string s) strlen = #114; // returns how many characters are in a string
string(string s1, string s2, ...) strcat = #115; // concatenates two or more strings (for example "abc", "def" would return "abcdef") and returns as a tempstring
string(string s, float start, float length) substring = #116; // returns a section of a string as a tempstring - see FTE_STRINGS for enhanced version
vector(string s) stov = #117; // returns vector value from a string
//void(string s) SV_ParseClientCommand;
//builtin definitions:
void(entity e, string s) clientcommand = #440;
-float(string s) tokenize = #441;
+int(string s) tokenize = #441;
string(float n) argv = #442;
//description:
//provides QC the ability to completely control server interpretation of client commands ("say" and "color" for example, clientcommand is necessary for this and substring (FRIK_FILE) is useful) as well as adding new commands (tokenize, argv, and stof (FRIK_FILE) are useful for this)), whenever a clc_stringcmd is received the QC function is called, and it is up to the QC to decide what (if anything) to do with it
.float style; // light style (like normal light entities, flickering torches or switchable, etc)
.float pflags; // flags (see PFLAGS_ constants)
.vector angles; // orientation of the light
-.float skin; // cubemap filter number, can be 1-255 (0 is assumed to be none, and tenebrae only allows 16-255), this selects a projective light filter, a value of 1 loads cubemaps/1posx.tga and cubemaps/1negx.tga and posy, negy, posz, and negz, similar to skybox but some sides need to be rotated or flipped
+.int skin; // cubemap filter number, can be 1-255 (0 is assumed to be none, and tenebrae only allows 16-255), this selects a projective light filter, a value of 1 loads cubemaps/1posx.tga and cubemaps/1negx.tga and posy, negy, posz, and negz, similar to skybox but some sides need to be rotated or flipped
//constants:
float PFLAGS_NOSHADOW = 1; // light does not cast shadows
float PFLAGS_CORONA = 2; // light has a corona flare
//darkplaces implementation: KrimZon
//builtin definitions:
int(string str, string sub, float startpos) strstrofs = #221; // returns the offset into a string of the matching text, or -1 if not found, case sensitive
-float(string str, float ofs) str2chr = #222; // returns the character at the specified offset as an integer, or 0 if an invalid index, or byte value - 256 if the engine supports UTF8 and the byte is part of an extended character
-string(float c, ...) chr2str = #223; // returns a string representing the character given, if the engine supports UTF8 this may be a multi-byte sequence (length may be more than 1) for characters over 127.
+int(string str, float ofs) str2chr = #222; // returns the character at the specified offset as an integer, or 0 if an invalid index, or byte value - 256 if the engine supports UTF8 and the byte is part of an extended character
+string(int c, ...) chr2str = #223; // returns a string representing the character given, if the engine supports UTF8 this may be a multi-byte sequence (length may be more than 1) for characters over 127.
string(float ccase, float calpha, float cnum, string s, ...) strconv = #224; // reformat a string with special color characters in the font, DO NOT USE THIS ON UTF8 ENGINES (if you are lucky they will emit ^4 and such color codes instead), the parameter values are 0=same/1=lower/2=upper for ccase, 0=same/1=white/2=red/5=alternate/6=alternate-alternate for redalpha, 0=same/1=white/2=red/3=redspecial/4=whitespecial/5=alternate/6=alternate-alternate for rednum.
string(float chars, string s, ...) strpad = #225; // pad string with spaces to a specified length, < 0 = left padding, > 0 = right padding
string(string info, string key, string value, ...) infoadd = #226; // sets or adds a key/value pair to an infostring - note: forbidden characters are \ and "
string(string info, string key) infoget = #227; // gets a key/value pair in an infostring, returns value or null if not found
-float(string s1, string s2) strcmp = #228; // compare two strings
-float(string s1, string s2, float len) strncmp = #228; // compare two strings up to the specified number of characters, if their length differs and is within the specified limit the result will be negative, otherwise it is the difference in value of their first non-matching character.
-float(string s1, string s2) strcasecmp = #229; // compare two strings with case-insensitive matching, characters a-z are considered equivalent to the matching A-Z character, no other differences, and this does not consider special characters equal even if they look similar
-float(string s1, string s2, float len) strncasecmp = #230; // same as strcasecmp but with a length limit, see strncmp
+int(string s1, string s2) strcmp = #228; // compare two strings
+int(string s1, string s2, float len) strncmp = #228; // compare two strings up to the specified number of characters, if their length differs and is within the specified limit the result will be negative, otherwise it is the difference in value of their first non-matching character.
+int(string s1, string s2) strcasecmp = #229; // compare two strings with case-insensitive matching, characters a-z are considered equivalent to the matching A-Z character, no other differences, and this does not consider special characters equal even if they look similar
+int(string s1, string s2, float len) strncasecmp = #230; // same as strcasecmp but with a length limit, see strncmp
//string(string s, float start, float length) substring = #116; // see note below
//description:
//various string manipulation functions
//darkplaces implementation: KrimZon
//description:
//various string manipulation functions
-float(string str, string sub, float startpos) strstrofs = #221;
-float(string str, float ofs) str2chr = #222;
-string(float c, ...) chr2str = #223;
+int(string str, string sub, float startpos) strstrofs = #221;
+int(string str, float ofs) str2chr = #222;
+string(int c, ...) chr2str = #223;
string(float ccase, float calpha, float cnum, string s, ...) strconv = #224;
string(float chars, string s, ...) strpad = #225;
string(string info, string key, string value, ...) infoadd = #226;
string(string info, string key) infoget = #227;
-float(string s1, string s2) strcmp = #228;
-float(string s1, string s2, float len) strncmp = #228;
-float(string s1, string s2) strcasecmp = #229;
-float(string s1, string s2, float len) strncasecmp = #230;
+int(string s1, string s2) strcmp = #228;
+int(string s1, string s2, float len) strncmp = #228;
+int(string s1, string s2) strcasecmp = #229;
+int(string s1, string s2, float len) strncasecmp = #230;
//DP_PRECACHE_PIC_FLAGS
//idea: divVerent
float coop;
float teamplay;
-float serverflags; // propagated from level to level, used to
+int serverflags; // propagated from level to level, used to
// keep track of completed episodes
float total_secrets;
.string classname; // spawn function
.string model;
.float frame;
-.float skin;
-.float effects;
+.int skin;
+.int effects;
.vector mins, maxs; // bounding box extents reletive to origin
.vector size; // maxs - mins
// stats
.float health;
.float frags;
-.float weapon; // one of the IT_SHOTGUN, etc flags
+.int weapon; // one of the IT_SHOTGUN, etc flags
.string weaponmodel;
.float weaponframe;
.float currentammo;
.float ammo_shells, ammo_nails, ammo_rockets, ammo_cells;
-.float items; // bit flags
+.int items; // bit flags
.float takedamage;
.entity chain;
.entity enemy;
-.float flags;
+.int flags;
-.float colormap;
+.int colormap;
.float team;
.float max_health; // players maximum health is stored here
.entity goalentity; // a movetarget or an enemy
-.float spawnflags;
+.int spawnflags;
.string target;
.string targetname;
void player_anim (void)
{
- float deadbits = (self.anim_state & (ANIMSTATE_DEAD1 | ANIMSTATE_DEAD2));
+ int deadbits = (self.anim_state & (ANIMSTATE_DEAD1 | ANIMSTATE_DEAD2));
if(self.deadflag) {
if (!deadbits) {
// Decide on which death animation to use.
// Clear a previous death animation.
deadbits = 0;
}
- float animbits = deadbits;
+ int animbits = deadbits;
if(self.frozen)
animbits |= ANIMSTATE_FROZEN;
if(self.crouch)
float LoadPlayerSounds(string f, float first);
-.float modelindex_for_playersound;
-.float skin_for_playersound;
+.int modelindex_for_playersound;
+.int skin_for_playersound;
void UpdatePlayerSounds();
void FakeGlobalSound(string sample, float chan, float voicetype);
.entity exteriorweaponentity;
.vector weaponentity_glowmod;
-//.float weapon; // current weapon
+//.int 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)
.string weaponname; // name of .weapon
float next_pingtime;
.float Version;
-.float SendFlags;
+.int SendFlags;
.float(entity to, float sendflags) SendEntity;
// player sounds, voice messages
#ifndef BUMBLEBEE_H
#define BUMBLEBEE_H
-const float BRG_SETUP = 2;
-const float BRG_START = 4;
-const float BRG_END = 8;
+const int BRG_SETUP = 2;
+const int BRG_START = 4;
+const int BRG_END = 8;
#ifdef SVQC
// Auto cvars
#define VEHICLES_ENABLED
#ifdef VEHICLES_ENABLED
-.float vehicle_flags;
-const float VHF_ISVEHICLE = 2; /// Indicates vehicle
-const float VHF_HASSHIELD = 4; /// Vehicle has shileding
-const float VHF_SHIELDREGEN = 8; /// Vehicles shield regenerates
-const float VHF_HEALTHREGEN = 16; /// Vehicles health regenerates
-const float VHF_ENERGYREGEN = 32; /// Vehicles energy regenerates
-const float VHF_DEATHEJECT = 64; /// Vehicle ejects pilot upon fatal damage
-const float VHF_MOVE_GROUND = 128; /// Vehicle moves on gound
-const float VHF_MOVE_HOVER = 256; /// Vehicle hover close to gound
-const float VHF_MOVE_FLY = 512; /// Vehicle is airborn
-const float VHF_DMGSHAKE = 1024; /// Add random velocity each frame if health < 50%
-const float VHF_DMGROLL = 2048; /// Add random angles each frame if health < 50%
-const float VHF_DMGHEADROLL = 4096; /// Add random head angles each frame if health < 50%
-const float VHF_MULTISLOT = 8192; /// Vehicle has multiple player slots
-const float VHF_PLAYERSLOT = 16384; /// This ent is a player slot on a multi-person vehicle
+.int vehicle_flags;
+const int VHF_ISVEHICLE = 2; /// Indicates vehicle
+const int VHF_HASSHIELD = 4; /// Vehicle has shileding
+const int VHF_SHIELDREGEN = 8; /// Vehicles shield regenerates
+const int VHF_HEALTHREGEN = 16; /// Vehicles health regenerates
+const int VHF_ENERGYREGEN = 32; /// Vehicles energy regenerates
+const int VHF_DEATHEJECT = 64; /// Vehicle ejects pilot upon fatal damage
+const int VHF_MOVE_GROUND = 128; /// Vehicle moves on gound
+const int VHF_MOVE_HOVER = 256; /// Vehicle hover close to gound
+const int VHF_MOVE_FLY = 512; /// Vehicle is airborn
+const int VHF_DMGSHAKE = 1024; /// Add random velocity each frame if health < 50%
+const int VHF_DMGROLL = 2048; /// Add random angles each frame if health < 50%
+const int VHF_DMGHEADROLL = 4096; /// Add random head angles each frame if health < 50%
+const int VHF_MULTISLOT = 8192; /// Vehicle has multiple player slots
+const int VHF_PLAYERSLOT = 16384; /// This ent is a player slot on a multi-person vehicle
.entity gun1;
.entity gun2;
return FP_ZERO;
return FP_NORMAL;
}
-int isfinite(float x)
+bool isfinite(float x)
{
return !(isnan(x) || isinf(x));
}
-int isinf(float x)
+bool isinf(float x)
{
return (x != 0) && (x + x == x);
}
-int isnan(float x)
+bool isnan(float x)
{
float y;
y = x;
return (x != y);
}
-int isnormal(float x)
+bool isnormal(float x)
{
return isfinite(x);
}
-int signbit(float x)
+bool signbit(float x)
{
return (x < 0);
}
// The commented-out functions need no implementation because DarkPlaces offers
// them as builtins. They are listed here anyway for completeness sake.
-const float FP_NAN = 0;
-const float FP_INFINITE = 1;
-const float FP_ZERO = 2;
-const float FP_SUBNORMAL = 3;
-const float FP_NORMAL = 4;
+const int FP_NAN = 0;
+const int FP_INFINITE = 1;
+const int FP_ZERO = 2;
+const int FP_SUBNORMAL = 3;
+const int FP_NORMAL = 4;
int fpclassify(float x);
-int isfinite(float x);
-int isinf(float x);
-int isnan(float x);
-int isnormal(float x);
-int signbit(float x);
+bool isfinite(float x);
+bool isinf(float x);
+bool isnan(float x);
+bool isnormal(float x);
+bool signbit(float x);
//float acos(float x);
//float asin(float x);