int ps_primary, ps_secondary;
int ts_primary, ts_secondary;
-float last_switchweapon;
-float last_activeweapon;
+int last_switchweapon;
+int last_activeweapon;
float weapontime;
float weaponprevtime;
var void HUD_ModIcons_GameType(vector pos, vector size);
void HUD_ModIcons_SetFunc();
-#endif
\ No newline at end of file
+#endif
float spectatorbutton_zoom;
float button_attack2;
-float activeweapon;
-float switchingweapon;
-float switchweapon;
+int activeweapon;
+int switchingweapon;
+int switchweapon;
float current_viewzoom;
float zoomin_effect;
float warmup_stage;
float hud;
float view_quality;
int framecount;
-#endif
\ No newline at end of file
+#endif
// - Loads campaign level data (up to n entries starting at offset)
// into the globals
// - Returns the number of entries successfully read
-float CampaignFile_Load(float offset, float n)
+float CampaignFile_Load(int offset, float n)
{
float fh;
float lineno;
}
}
-float MapInfo_ForbiddenFlags()
+int MapInfo_ForbiddenFlags()
{
int f = MAPINFO_FLAG_FORBIDDEN;
return f;
}
-float MapInfo_RequiredFlags()
+int MapInfo_RequiredFlags()
{
int f = 0;
float MapInfo_FilterGametype(float gametype, float features, float pFlagsRequired, float pFlagsForbidden, float pAbortOnGenerate); // 1 on success, 0 on temporary failure (call it again next frame then; use MapInfo_progress as progress indicator)
int MapInfo_CurrentFeatures(); // retrieves currently required features from cvars
int MapInfo_CurrentGametype(); // retrieves current gametype from cvars
-float MapInfo_ForbiddenFlags(); // retrieves current flags from cvars
-float MapInfo_RequiredFlags(); // retrieves current flags from cvars
+int MapInfo_ForbiddenFlags(); // retrieves current flags from cvars
+int MapInfo_RequiredFlags(); // retrieves current flags from cvars
// load info about the i-th map into the MapInfo_Map_* globals
float MapInfo_Get_ByID(float i); // 1 on success, 0 on failure
#define MAPINFO_SETTEMP_ACL_USER cvar_string("g_mapinfo_settemp_acl")
#define MAPINFO_SETTEMP_ACL_SYSTEM "-g_mapinfo_* -rcon_* -_* -g_ban* +*"
-#endif
\ No newline at end of file
+#endif
{ s = e.crypto_idfp; }
else if(IS_BOT_CLIENT(e))
{ s = sprintf("bot#%g#%s", skill, e.cleanname); }
-
+
if((s == "") || find(world, playerstats_id, s)) // already have one of the ID - next one can't be tracked then!
{
if(IS_BOT_CLIENT(e))
else
{ s = sprintf("player#%d", e.playerid); }
}
-
+
e.playerstats_id = strzone(s);
// now add the player to the database
string key = sprintf("%s:*", e.playerstats_id);
string p = db_get(PS_GR_OUT_DB, key);
-
+
if(p == "")
{
if(PS_GR_OUT_PL)
string key = sprintf("%d", t);
string p = db_get(PS_GR_OUT_DB, key);
-
+
if(p == "")
{
if(PS_GR_OUT_TL)
string key = sprintf("*:%s", event_id);
string p = db_get(PS_GR_OUT_DB, key);
-
+
if(p == "")
{
if(PS_GR_OUT_EVL)
void PlayerStats_GameReport(float finished)
{
if(PS_GR_OUT_DB < 0) { return; }
-
+
PlayerScore_Sort(score_dummyfield, 0, 0, 0);
PlayerScore_Sort(scoreboard_pos, 1, 1, 1);
if(teamplay) { PlayerScore_TeamStats(); }
nn = db_get(PS_GR_OUT_DB, sprintf("%s:_playerid", p));
if(nn != "") { url_fputs(fh, sprintf("i %s\n", nn)); }
- // player name
+ // player name
nn = db_get(PS_GR_OUT_DB, sprintf("%s:_netname", p));
if(nn != "") { url_fputs(fh, sprintf("n %s\n", nn)); }
url_fclose(fh);
break;
}
-
+
case URL_READY_CLOSED:
{
// url_fclose has finished
}
break;
}
-
+
case URL_READY_ERROR:
default:
{
url_fclose(fh);
break;
}
-
+
case URL_READY_CANREAD:
{
string s = "";
print("Player stats synchronized with server\n");
break;
}
-
+
case URL_READY_ERROR:
default:
{
db_put(PS_D_IN_DB, marker, PS_D_IN_EVL);
strunzone(PS_D_IN_EVL);
}
- else { db_put(PS_D_IN_DB, marker, "#"); }
+ else { db_put(PS_D_IN_DB, marker, "#"); }
PS_D_IN_EVL = strzone(marker);
}
url_fclose(fh);
break;
}
-
+
case URL_READY_CANREAD:
{
//print("PlayerStats_PlayerDetail_Handler(): Got response from player stats server:\n");
string key = "", event = "", data = "";
if(argv(0) == "#") { continue; }
-
+
if(count == 2)
{
key = argv(0);
}
break;
}
-
+
default:
{
printf(
float TEST_RunAll()
{
- float f = 0;
+ int f = 0;
float n = numentityfields();
- float i;
- for(i = 0; i < n; ++i)
+ for(int i = 0; i < n; ++i)
{
string name = entityfieldname(i);
if(substring(name, 0, 6) == "_TEST_")
//idea: LordHavoc
//darkplaces implementation: LordHavoc
//effects bit:
-float EF_LOWPRECISION = 4194304;
+const int EF_LOWPRECISION = 4194304;
//description:
//uses low quality origin coordinates, reducing network traffic compared to the default high precision, intended for numerous objects (projectiles/gibs/bullet holes/etc).
//idea: FrikaC
//darkplaces implementation: LordHavoc
//effects bit:
-float EF_SELECTABLE = 16384; // allows cursor to highlight entity (brighten)
+const int EF_SELECTABLE = 16384; // allows cursor to highlight entity (brighten)
//field definitions:
.float cursor_active; // true if cl_prydoncursor mode is on
.vector cursor_screen; // screen position of cursor as -1 to +1 in _x and _y (_z unused)
float(string url, float id, string content_type, string delim, float buf, float keyid) crypto_uri_postbuf = #513;
//description:
//use -1 as buffer handle to justs end delim as postdata
-#endif
\ No newline at end of file
+#endif
float mouseButtonsPressed;
vector menuMousePos;
-float menuShiftState;
+int menuShiftState;
float menuPrevTime;
float menuAlpha;
float menuLogoAlpha;
// constants
-const float GAME_ISSERVER = 1;
-const float GAME_CONNECTED = 2;
-const float GAME_DEVELOPER = 4;
+const int GAME_ISSERVER = 1;
+const int GAME_CONNECTED = 2;
+const int GAME_DEVELOPER = 4;
// prototypes
float Menu_Active;
-float gamestatus;
+int gamestatus;
-const float S_SHIFT = 1;
-const float S_CTRL = 2;
-const float S_ALT = 4;
+const int S_SHIFT = 1;
+const int S_CTRL = 2;
+const int S_ALT = 4;
float frametime;
float time;
void postMenuDraw(); // this is run just after the menu is drawn (or not). Useful to draw something over everything else.
void m_sync();
-#endif
\ No newline at end of file
+#endif
ATTRIB(XonoticEffectsSettingsTab, columns, float, 6.2) // added extra .2 for center space
ENDCLASS(XonoticEffectsSettingsTab)
entity makeXonoticEffectsSettingsTab();
-float updateCompression();
#endif
#ifdef IMPLEMENTATION
n = tokenizebyseparator(data, "\n");
float i;
- string s;
-
+ string s;
+
string un_version = "";
string un_download = "";
string un_url = "";
string un_promoted = "";
string un_recommended = "";
string un_compatexpire = "";
-
+
for(i = 0; i < n; ++i)
{
s = substring(argv(i), 2, -1);
if(s == "") { continue; } // ignore empty lines
-
+
switch(substring(argv(i), 0, 1))
{
case "V":
}
}
}
-
+
if(un_emergency_pk3s != "")
{
_Nex_ExtResponseSystem_Packs = strzone(un_emergency_pk3s);
void setDependentStringNotEqual(entity e, string theCvarName, string theCvarValue);
void setDependentWeird(entity e, float(entity) func);
-float tooltipdb;
+int tooltipdb;
void loadTooltips();
void unloadTooltips();
string getZonedTooltipForIdentifier(string s);
string resolvemod(string m);
+float updateCompression();
+
void UpdateNotification_URI_Get_Callback(float id, float status, string data);
void URI_Get_Callback(float id, float status, string data);
float _Nex_ExtResponseSystem_RecommendedServersNeedsRefresh;
void CheckSendCvars(entity me, string cvarnamestring);
-#endif
\ No newline at end of file
+#endif
#include "antilag.qh"
#endif
-const float ANTILAG_MAX_ORIGINS = 64;
+const int ANTILAG_MAX_ORIGINS = 64;
.vector antilag_origins[ANTILAG_MAX_ORIGINS];
.float antilag_times[ANTILAG_MAX_ORIGINS];
-.float antilag_index;
+.int antilag_index;
.vector antilag_saved_origin;
.float antilag_takenback;
// finds the index BEFORE t
float antilag_find(entity e, float t)
{
- float i;
-
- for(i = e.antilag_index; i > 0; --i)
+ for(int i = e.antilag_index; i > 0; --i)
if(e.(antilag_times[i]) >= t)
if(e.(antilag_times[i - 1]) < t)
return i - 1;
if(e.(antilag_times[ANTILAG_MAX_ORIGINS - 1]) < t)
return ANTILAG_MAX_ORIGINS - 1;
- for(i = ANTILAG_MAX_ORIGINS - 1; i > e.antilag_index + 1; --i)
+ for(int i = ANTILAG_MAX_ORIGINS - 1; i > e.antilag_index + 1; --i)
if(e.(antilag_times[i]) >= t)
if(e.(antilag_times[i - 1]) < t)
return i - 1;
void bot_custom_weapon_priority_setup()
{
- float tokens, i, c, w;
+ float tokens, i, w;
bot_custom_weapon = false;
// Parse far distance weapon priorities
tokens = tokenizebyseparator(W_NumberWeaponOrder(autocvar_bot_ai_custom_weapon_priority_far)," ");
- c = 0;
+ int c = 0;
for(i=0; i < tokens && c < WEP_COUNT; ++i){
w = stof(argv(i));
if ( w >= WEP_FIRST && w <= WEP_LAST) {
* Globals and Fields
*/
-const float AI_STATUS_ROAMING = 1; // Bot is just crawling the map. No enemies at sight
-const float AI_STATUS_ATTACKING = 2; // There are enemies at sight
-const float AI_STATUS_RUNNING = 4; // Bot is bunny hopping
-const float AI_STATUS_DANGER_AHEAD = 8; // There is lava/slime/trigger_hurt ahead
-const float AI_STATUS_OUT_JUMPPAD = 16; // Trying to get out of a "vertical" jump pad
-const float AI_STATUS_OUT_WATER = 32; // Trying to get out of water
-const float AI_STATUS_WAYPOINT_PERSONAL_LINKING = 64; // Waiting for the personal waypoint to be linked
-const float AI_STATUS_WAYPOINT_PERSONAL_GOING = 128; // Going to a personal waypoint
-const float AI_STATUS_WAYPOINT_PERSONAL_REACHED = 256; // Personal waypoint reached
-const float AI_STATUS_JETPACK_FLYING = 512;
-const float AI_STATUS_JETPACK_LANDING = 1024;
-const float AI_STATUS_STUCK = 2048; // Cannot reach any goal
+const int AI_STATUS_ROAMING = 1; // Bot is just crawling the map. No enemies at sight
+const int AI_STATUS_ATTACKING = 2; // There are enemies at sight
+const int AI_STATUS_RUNNING = 4; // Bot is bunny hopping
+const int AI_STATUS_DANGER_AHEAD = 8; // There is lava/slime/trigger_hurt ahead
+const int AI_STATUS_OUT_JUMPPAD = 16; // Trying to get out of a "vertical" jump pad
+const int AI_STATUS_OUT_WATER = 32; // Trying to get out of water
+const int AI_STATUS_WAYPOINT_PERSONAL_LINKING = 64; // Waiting for the personal waypoint to be linked
+const int AI_STATUS_WAYPOINT_PERSONAL_GOING = 128; // Going to a personal waypoint
+const int AI_STATUS_WAYPOINT_PERSONAL_REACHED = 256; // Personal waypoint reached
+const int AI_STATUS_JETPACK_FLYING = 512;
+const int AI_STATUS_JETPACK_LANDING = 1024;
+const int AI_STATUS_STUCK = 2048; // Cannot reach any goal
.float isbot; // true if this client is actually a bot
-.float aistatus;
+.int aistatus;
// Skill system
float skill;
float JoinBestTeam(entity pl, float only_return_best, float forcebestteam);
void bot_calculate_stepheightvec(void);
-#endif
\ No newline at end of file
+#endif
self.havocbot_stickenemy = true;
}
-float havocbot_chooseweapon_checkreload(float new_weapon)
+float havocbot_chooseweapon_checkreload(int new_weapon)
{
// bots under this skill cannot find unloaded weapons to reload idly when not in combat,
// so skip this for them, or they'll never get to reload their weapons at all.
void havocbot_chooseweapon()
{
- float i;
+ int i;
// ;)
if(g_weaponarena_weapons == WEPSET_TUBA)
}
// Do not change weapon during the next second after a combo
- i = time - self.lastcombotime;
- if(i < 1)
+ float f = time - self.lastcombotime;
+ if(f < 1)
return;
float w;
-const float HAVOCBOT_ONS_ROLE_NONE = 0;
-const float HAVOCBOT_ONS_ROLE_DEFENSE = 2;
-const float HAVOCBOT_ONS_ROLE_ASSISTANT = 4;
-const float HAVOCBOT_ONS_ROLE_OFFENSE = 8;
+const int HAVOCBOT_ONS_ROLE_NONE = 0;
+const int HAVOCBOT_ONS_ROLE_DEFENSE = 2;
+const int HAVOCBOT_ONS_ROLE_ASSISTANT = 4;
+const int HAVOCBOT_ONS_ROLE_OFFENSE = 8;
-.float havocbot_role_flags;
+.int havocbot_role_flags;
.float havocbot_attack_time;
.void() havocbot_role;
dprint("\n");
}
-float havocbot_ons_teamcount(entity bot, float role)
+float havocbot_ons_teamcount(entity bot, int role)
{
float c = 0;
entity head;
void havocbot_goalrating_enemyplayers(float ratingscale, vector org, float sradius)
{
entity head;
- float t, noteam, distance;
- noteam = ((self.team == 0) || !teamplay);
+ int t;
+ float distance;
+ noref bool noteam = ((self.team == 0) || !teamplay);
if (autocvar_bot_nofire)
return;
return 1;
}
-const float MAX_BOT_PLACES = 4;
+const int MAX_BOT_PLACES = 4;
.float bot_places_count;
.entity bot_places[MAX_BOT_PLACES];
.string bot_placenames[MAX_BOT_PLACES];
entity e;
if(substring(placename, 0, 1) == "@")
{
- float i, p;
+ int i, p;
placename = substring(placename, 1, -1);
string s, s2;
for(i = 0; i < self.bot_places_count; ++i)
// NOTE: New commands should be added here. Do not forget to update BOT_CMD_COUNTER
-const float BOT_CMD_NULL = 0;
-const float BOT_CMD_PAUSE = 1;
-const float BOT_CMD_CONTINUE = 2;
-const float BOT_CMD_WAIT = 3;
-const float BOT_CMD_TURN = 4;
-const float BOT_CMD_MOVETO = 5;
-const float BOT_CMD_RESETGOAL = 6; // Not implemented yet
-const float BOT_CMD_CC = 7;
-const float BOT_CMD_IF = 8;
-const float BOT_CMD_ELSE = 9;
-const float BOT_CMD_FI = 10;
-const float BOT_CMD_RESETAIM = 11;
-const float BOT_CMD_AIM = 12;
-const float BOT_CMD_PRESSKEY = 13;
-const float BOT_CMD_RELEASEKEY = 14;
-const float BOT_CMD_SELECTWEAPON = 15;
-const float BOT_CMD_IMPULSE = 16;
-const float BOT_CMD_WAIT_UNTIL = 17;
-const float BOT_CMD_MOVETOTARGET = 18;
-const float BOT_CMD_AIMTARGET = 19;
-const float BOT_CMD_BARRIER = 20;
-const float BOT_CMD_CONSOLE = 21;
-const float BOT_CMD_SOUND = 22;
-const float BOT_CMD_DEBUG_ASSERT_CANFIRE = 23;
-const float BOT_CMD_WHILE = 24; // TODO: Not implemented yet
-const float BOT_CMD_WEND = 25; // TODO: Not implemented yet
-const float BOT_CMD_CHASE = 26; // TODO: Not implemented yet
-
-const float BOT_CMD_COUNTER = 24; // Update this value if you add/remove a command
+const int BOT_CMD_NULL = 0;
+const int BOT_CMD_PAUSE = 1;
+const int BOT_CMD_CONTINUE = 2;
+const int BOT_CMD_WAIT = 3;
+const int BOT_CMD_TURN = 4;
+const int BOT_CMD_MOVETO = 5;
+const int BOT_CMD_RESETGOAL = 6; // Not implemented yet
+const int BOT_CMD_CC = 7;
+const int BOT_CMD_IF = 8;
+const int BOT_CMD_ELSE = 9;
+const int BOT_CMD_FI = 10;
+const int BOT_CMD_RESETAIM = 11;
+const int BOT_CMD_AIM = 12;
+const int BOT_CMD_PRESSKEY = 13;
+const int BOT_CMD_RELEASEKEY = 14;
+const int BOT_CMD_SELECTWEAPON = 15;
+const int BOT_CMD_IMPULSE = 16;
+const int BOT_CMD_WAIT_UNTIL = 17;
+const int BOT_CMD_MOVETOTARGET = 18;
+const int BOT_CMD_AIMTARGET = 19;
+const int BOT_CMD_BARRIER = 20;
+const int BOT_CMD_CONSOLE = 21;
+const int BOT_CMD_SOUND = 22;
+const int BOT_CMD_DEBUG_ASSERT_CANFIRE = 23;
+const int BOT_CMD_WHILE = 24; // TODO: Not implemented yet
+const int BOT_CMD_WEND = 25; // TODO: Not implemented yet
+const int BOT_CMD_CHASE = 26; // TODO: Not implemented yet
+
+const int BOT_CMD_COUNTER = 24; // Update this value if you add/remove a command
// NOTE: Following commands should be implemented on the bot ai
// If a new command should be handled by the target ai(s) please declare it here
.float() cmd_resetgoal;
//
-const float BOT_CMD_PARAMETER_NONE = 0;
-const float BOT_CMD_PARAMETER_FLOAT = 1;
-const float BOT_CMD_PARAMETER_STRING = 2;
-const float BOT_CMD_PARAMETER_VECTOR = 3;
+const int BOT_CMD_PARAMETER_NONE = 0;
+const int BOT_CMD_PARAMETER_FLOAT = 1;
+const int BOT_CMD_PARAMETER_STRING = 2;
+const int BOT_CMD_PARAMETER_VECTOR = 3;
float bot_cmds_initialized;
-float bot_cmd_parm_type[BOT_CMD_COUNTER];
+int bot_cmd_parm_type[BOT_CMD_COUNTER];
string bot_cmd_string[BOT_CMD_COUNTER];
// Bots command queue
.float is_bot_cmd; // Tells if the entity is a bot command
.float bot_cmd_index; // Position of the command in the queue
-.float bot_cmd_type; // If of command (see the BOT_CMD_* defines)
+.int bot_cmd_type; // If of command (see the BOT_CMD_* defines)
.float bot_cmd_parm_float; // Field to store a float parameter
.string bot_cmd_parm_string; // Field to store a string parameter
.vector bot_cmd_parm_vector; // Field to store a vector parameter
float bot_decodecommand(string cmdstring)
{
- float cmd_parm_type, i;
+ float cmd_parm_type;
float sp;
string parm;
if(!bot_cmds_initialized)
bot_commands_init();
+ int i;
for(i=1;i<BOT_CMD_COUNTER;++i)
{
if(bot_cmd_string[i]!=cmdstring)
void bot_cmdhelp(string scmd)
{
- float i, ntype;
+ int i, ntype;
string stype;
if(!bot_cmds_initialized)
void bot_list_commands()
{
- float i;
+ int i;
string ptype;
if(!bot_cmds_initialized)
}
// Commands code
-.float bot_exec_status;
+.int bot_exec_status;
#define BOT_EXEC_STATUS_IDLE 0
#define BOT_EXEC_STATUS_PAUSED 1
return CMD_STATUS_FINISHED;
}
-.float bot_cmd_condition_status;
+.int bot_cmd_condition_status;
-const float CMD_CONDITION_NONE = 0;
-const float CMD_CONDITION_true = 1;
-const float CMD_CONDITION_false = 2;
-const float CMD_CONDITION_true_BLOCK = 4;
-const float CMD_CONDITION_false_BLOCK = 8;
+const int CMD_CONDITION_NONE = 0;
+const int CMD_CONDITION_true = 1;
+const int CMD_CONDITION_false = 2;
+const int CMD_CONDITION_true_BLOCK = 4;
+const int CMD_CONDITION_false_BLOCK = 8;
float bot_cmd_eval(string expr)
{
return CMD_STATUS_EXECUTING;
}
-.float bot_cmd_keys;
-
-const float BOT_CMD_KEY_NONE = 0;
-const float BOT_CMD_KEY_FORWARD = 1;
-const float BOT_CMD_KEY_BACKWARD = 2;
-const float BOT_CMD_KEY_RIGHT = 4;
-const float BOT_CMD_KEY_LEFT = 8;
-const float BOT_CMD_KEY_JUMP = 16;
-const float BOT_CMD_KEY_ATTACK1 = 32;
-const float BOT_CMD_KEY_ATTACK2 = 64;
-const float BOT_CMD_KEY_USE = 128;
-const float BOT_CMD_KEY_HOOK = 256;
-const float BOT_CMD_KEY_CROUCH = 512;
-const float BOT_CMD_KEY_CHAT = 1024;
+.int bot_cmd_keys;
+
+const int BOT_CMD_KEY_NONE = 0;
+const int BOT_CMD_KEY_FORWARD = 1;
+const int BOT_CMD_KEY_BACKWARD = 2;
+const int BOT_CMD_KEY_RIGHT = 4;
+const int BOT_CMD_KEY_LEFT = 8;
+const int BOT_CMD_KEY_JUMP = 16;
+const int BOT_CMD_KEY_ATTACK1 = 32;
+const int BOT_CMD_KEY_ATTACK2 = 64;
+const int BOT_CMD_KEY_USE = 128;
+const int BOT_CMD_KEY_HOOK = 256;
+const int BOT_CMD_KEY_CROUCH = 512;
+const int BOT_CMD_KEY_CHAT = 1024;
float bot_presskeys()
{
* Globals and Fields
*/
-const float WAYPOINTFLAG_GENERATED = 8388608;
-const float WAYPOINTFLAG_ITEM = 4194304;
-const float WAYPOINTFLAG_TELEPORT = 2097152;
-const float WAYPOINTFLAG_NORELINK = 1048576;
-const float WAYPOINTFLAG_PERSONAL = 524288;
-const float WAYPOINTFLAG_PROTECTED = 262144; // Useless WP detection never kills these.
-const float WAYPOINTFLAG_USEFUL = 131072; // Useless WP detection temporary flag.
-const float WAYPOINTFLAG_DEAD_END = 65536; // Useless WP detection temporary flag.
+const int WAYPOINTFLAG_GENERATED = 8388608;
+const int WAYPOINTFLAG_ITEM = 4194304;
+const int WAYPOINTFLAG_TELEPORT = 2097152;
+const int WAYPOINTFLAG_NORELINK = 1048576;
+const int WAYPOINTFLAG_PERSONAL = 524288;
+const int WAYPOINTFLAG_PROTECTED = 262144; // Useless WP detection never kills these.
+const int WAYPOINTFLAG_USEFUL = 131072; // Useless WP detection temporary flag.
+const int WAYPOINTFLAG_DEAD_END = 65536; // Useless WP detection temporary flag.
// fields you can query using prvm_global server to get some statistics about waypoint linking culling
float relink_total, relink_walkculled, relink_pvsculled, relink_lengthculled;
.float wp16mincost, wp17mincost, wp18mincost, wp19mincost, wp20mincost, wp21mincost, wp22mincost, wp23mincost;
.float wp24mincost, wp25mincost, wp26mincost, wp27mincost, wp28mincost, wp29mincost, wp30mincost, wp31mincost;
-.float wpfire, wpcost, wpconsidered, wpisbox, wpflags, wplinked, wphardwired;
+.float wpfire, wpcost, wpconsidered, wpisbox, wplinked, wphardwired;
+.int wpflags;
.vector wpnearestpoint;
vector waypoint_fixorigin(vector position);
void botframe_autowaypoints();
-#endif
\ No newline at end of file
+#endif
WriteByte(MSG_BROADCAST, TE_CSQC_TEAMNAGGER);
}
-float ClientData_Send(entity to, float sf)
+float ClientData_Send(entity to, int sf)
{
if(to != self.owner)
{
self.bot_attack = true;
self.monster_attack = true;
-
+
self.spider_slowness = 0;
self.BUTTON_ATCK = self.BUTTON_JUMP = self.BUTTON_ATCK2 = 0;
WEP_ACTION(j, WR_RESETPLAYER);
// all weapons must be fully loaded when we spawn
- entity e;
- e = get_weaponinfo(j);
+ entity e = get_weaponinfo(j);
if(e.spawnflags & WEP_FLAG_RELOADABLE) // prevent accessing undefined cvars
self.(weapon_load[j]) = e.reloading_ammo;
}
*/
.float usekeypressed;
void() nexball_setstatus;
-.float items_added;
+.int items_added;
void PlayerPreThink (void)
{
WarpZone_PlayerPhysics_FixVAngle();
{
self.revive_progress = bound(0, self.revive_progress - frametime * self.revive_speed, 1);
self.health = max(0, autocvar_g_nades_ice_health + (start_health-autocvar_g_nades_ice_health) * self.revive_progress );
-
+
if(self.health < 1)
{
if(self.vehicle)
do_crouch = 0;
// WEAPONTODO: THIS SHIT NEEDS TO GO EVENTUALLY
- // It cannot be predicted by the engine!
+ // It cannot be predicted by the engine!
if((self.weapon == WEP_SHOCKWAVE || self.weapon == WEP_SHOTGUN) && self.weaponentity.wframe == WFRAME_FIRE2 && time < self.weapon_nextthink)
do_crouch = 0;
player_regen();
- // WEAPONTODO: Add a weapon request for this
+ // WEAPONTODO: Add a weapon request for this
// rot vortex charge to the charge limit
if(WEP_CVAR(vortex, charge_rot_rate) && self.vortex_charge > WEP_CVAR(vortex, charge_limit) && self.vortex_charge_rottime < time)
self.vortex_charge = bound(WEP_CVAR(vortex, charge_limit), self.vortex_charge - WEP_CVAR(vortex, charge_rot_rate) * frametime / W_TICSPERFRAME, 1);
void ImpulseCommands (void)
{
- float imp;
+ int imp;
vector org;
float i;
float m;
.entity ladder_entity;
.float gravity;
.float swamp_slowdown;
-.float lastflags;
+.int lastflags;
.float lastground;
.float wasFlying;
.float spectatorspeed;
vector wishvel, wishdir, v;
float wishspeed, f, maxspd_mod, spd, maxairspd, airaccel, swampspd_mod, buttons;
string temps;
- float buttons_prev;
+ int buttons_prev;
float not_allowed_to_move;
string c;
self.respawn_flags = self.respawn_flags | RESPAWN_FORCE;
}
-void PlayerDamage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void PlayerDamage (entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
- float take, save, dh, da, j;
+ float take, save, dh, da;
+ int j;
vector v;
float valid_damage_for_weaponstats;
float excess;
Obituary (attacker, inflictor, self, deathtype);
// increment frag counter for used weapon type
- float w;
- w = DEATH_WEAPONOF(deathtype);
+ int w = DEATH_WEAPONOF(deathtype);
if(WEP_VALID(w))
if(accuracy_isgooddamage(attacker, self))
attacker.accuracy.(accuracy_frags[w-1]) += 1;
void ClientKill_Now_TeamChange();
-void PlayerDamage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force);
+void PlayerDamage (entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force);
.float muted; // to be used by prvm_edictset server playernumber muted 1
float Say(entity source, float teamsay, entity privatesay, string msgin, float floodcontrol);
void VoiceMessage(string type, string msg);
void MoveToTeam(entity client, float team_colour, float type);
-#endif
\ No newline at end of file
+#endif
{
case CMD_REQUEST_COMMAND:
{
- float i;
-
- for(i = 0; i < 10; ++i)
+ for(int i = 0; i < 10; ++i)
if(records_reply[i] != "")
print_to(caller, records_reply[i]);
string getladder()
{
- float i, j, k, uidcnt = 0, thiscnt;
+ int i, j, k, uidcnt = 0, thiscnt;
string s, temp_s, rr, myuid, thisuid;
rr = (g_cts) ? CTS_RECORD : RACE_RECORD;
string getmaplist()
{
string maplist = "", col;
- float i, argc;
+ int i, argc;
argc = tokenize_console(autocvar_g_maplist);
for(i = 0; i < argc; ++i)
string getmonsterlist()
{
string monsterlist = "", col;
- float i;
- for(i = MON_FIRST; i <= MON_LAST; ++i)
+ for(int i = MON_FIRST; i <= MON_LAST; ++i)
{
if(i % 2) { col = "^2"; }
else { col = "^3"; }
// ======================================================
// ladder bullshit todo
-const float LADDER_FIRSTPOINT = 100;
+const int LADDER_FIRSTPOINT = 100;
#define LADDER_CNT 10 // position X still gives LADDER_FIRSTPOINT/X points
-const float LADDER_SIZE = 30; // ladder shows the top X players
+const int LADDER_SIZE = 30; // ladder shows the top X players
string top_uids[LADDER_SIZE];
float top_scores[LADDER_SIZE];
string getmaplist(void);
string getlsmaps(void);
string getmonsterlist(void);
-#endif
\ No newline at end of file
+#endif
return c / q;
}
-void sharpen_set(float x, float v)
+void sharpen_set(int x, float v)
{
sharpen_buffer[x + 2 * RADAR_WIDTH_MAX] = v;
}
}
float sharpen_get(float x, float a)
{
- float sum;
- sum = sharpen_getpixel(x, 1);
+ float sum = sharpen_getpixel(x, 1);
if(a == 0)
return sum;
sum *= (8 + 1/a);
sum -= sharpen_getpixel(x, 2);
return bound(0, sum * a, 1);
}
-void sharpen_shift(float w)
+void sharpen_shift(int w)
{
- float i;
- for(i = 0; i < w; ++i)
+ for(int i = 0; i < w; ++i)
{
sharpen_buffer[i] = sharpen_buffer[i + RADAR_WIDTH_MAX];
sharpen_buffer[i + RADAR_WIDTH_MAX] = sharpen_buffer[i + 2 * RADAR_WIDTH_MAX];
sharpen_buffer[i + 2 * RADAR_WIDTH_MAX] = 0;
}
}
-void sharpen_init(float w)
+void sharpen_init(int w)
{
- float i;
- for(i = 0; i < w; ++i)
+ for(int i = 0; i < w; ++i)
{
sharpen_buffer[i] = 0;
sharpen_buffer[i + RADAR_WIDTH_MAX] = 0;
entity radarmapper;
-const float RADAR_WIDTH_MAX = 512;
-const float RADAR_HEIGHT_MAX = 512;
+const int RADAR_WIDTH_MAX = 512;
+const int RADAR_HEIGHT_MAX = 512;
float sharpen_buffer[RADAR_WIDTH_MAX * 3];
string doublehex = "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFFFF";
// FF is contained twice, to map 256 to FF too
// removes the need to bound()
-#endif
\ No newline at end of file
+#endif
string result1 = (argv(2) ? strcat("^7", argv(1)) : "^1HEADS");
string result2 = (argv(2) ? strcat("^7", argv(2)) : "^4TAILS");
string choice = ((random() > 0.5) ? result1 : result2);
-
+
Send_Notification(NOTIF_ALL, world, MSG_MULTI, MULTI_COINTOSS, choice);
return;
}
if(teamplay)
{
entity tmp_player;
- float i, x, z, t_teams, t_players, team_color;
+ int i;
+ float x, z, t_teams, t_players, team_color;
// count the total amount of players and total amount of teams
t_players = 0;
// Nagger for players to know status of voting
float Nagger_SendEntity(entity to, float sendflags)
{
- float nags, i, f, b;
+ int nags, i, f, b;
entity e;
WriteByte(MSG_ENTITY, ENT_CLIENT_NAGGER);
#ifndef SERVER_CONSTANTS_H
#define SERVER_CONSTANTS_H
-const float FL_WEAPON = 8192;
-const float FL_POWERUP = 16384;
-const float FL_PROJECTILE = 32768;
-const float FL_TOSSED = 65536;
-const float FL_NO_WEAPON_STAY = 131072;
-const float FL_SPAWNING = 262144;
+const int FL_WEAPON = 8192;
+const int FL_POWERUP = 16384;
+const int FL_PROJECTILE = 32768;
+const int FL_TOSSED = 65536;
+const int FL_NO_WEAPON_STAY = 131072;
+const int FL_SPAWNING = 262144;
-const float SVC_SOUND = 6;
-const float SVC_STOPSOUND = 16;
-const float SVC_SETVIEW = 5;
+const int SVC_SOUND = 6;
+const int SVC_STOPSOUND = 16;
+const int SVC_SETVIEW = 5;
-const float RESPAWN_FORCE = 1;
-const float RESPAWN_SILENT = 2;
+const int RESPAWN_FORCE = 1;
+const int RESPAWN_SILENT = 2;
#define EFMASK_CHEAP (EF_ADDITIVE | EF_DOUBLESIDED | EF_FULLBRIGHT | EF_NODEPTHTEST | EF_NODRAW | EF_NOGUNBOB | EF_NOSHADOW | EF_LOWPRECISION | EF_SELECTABLE | EF_TELEPORT_BIT)
-const float MSG_ENTITY = 5; // csqc
+const int MSG_ENTITY = 5; // csqc
-const float NUM_PLAYERSKINS_TEAMPLAY = 3;
+const int NUM_PLAYERSKINS_TEAMPLAY = 3;
-const float ASSAULT_VALUE_INACTIVE = 1000;
+const int ASSAULT_VALUE_INACTIVE = 1000;
-const float DOOR_NOSPLASH = 256; // generic anti-splashdamage spawnflag
-#endif
\ No newline at end of file
+const int DOOR_NOSPLASH = 256; // generic anti-splashdamage spawnflag
+#endif
//.float cnt2;
.float play_time;
-.float respawn_flags;
+.int respawn_flags;
.float respawn_time;
.float respawn_time_max;
.float death_time;
.vector weaponentity_glowmod;
//.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)
+.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];
string clientstuff;
.float phase;
-.float pressedkeys;
+.int pressedkeys;
.float porto_forbidden;
.float hit_time;
.float typehit_time;
-.float damage_dealt_total;
+.float damage_dealt_total;
.float stat_leadlimit;
.string playernick;
.float elos;
.float ranks;
-#endif
\ No newline at end of file
+#endif
return true;
}
-float entcs_send(entity to, float sf)
+float entcs_send(entity to, int sf)
{
WriteByte(MSG_ENTITY, ENT_CLIENT_ENTCS);
WriteByte(MSG_ENTITY, sf);
float entcs_customize();
-float entcs_send(entity to, float sf);
+float entcs_send(entity to, int sf);
void entcs_think();
entity attach_entcs();
void detach_entcs();
-#endif
\ No newline at end of file
+#endif
// Otherwise mdl_dead will be displayed at the map origin, and nobody would
// want that!
-void func_breakable_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force);
+void func_breakable_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force);
//
// func_breakable
self.colormod = '1 0 0' + '0 1 0' * (2 * h - 0.5);
else
self.colormod = '1 1 1';
-
+
CSQCMODEL_AUTOUPDATE();
}
{
func_breakable_look_destroyed();
func_breakable_behave_destroyed();
-
+
CSQCMODEL_AUTOUPDATE();
}
{
func_breakable_look_restore();
func_breakable_behave_restore();
-
+
CSQCMODEL_AUTOUPDATE();
}
self.message = oldmsg;
}
-void func_breakable_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void func_breakable_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
if(self.state == 1)
return;
func_breakable_behave_destroyed();
else
func_breakable_behave_restore();
-
+
CSQCMODEL_AUTOUPDATE();
}
self.reset = func_breakable_reset;
func_breakable_reset();
-
+
CSQCMODEL_AUTOINIT();
}
return true;
}
-void SpawnCasing(vector vel, float randomvel, vector ang, vector avel, float randomavel, float casingtype, entity casingowner)
+void SpawnCasing(vector vel, float randomvel, vector ang, vector avel, float randomavel, int casingtype, entity casingowner)
{
entity e;
vector org;
WepSet start_weapons;
WepSet start_weapons_default;
WepSet start_weapons_defaultmask;
-float start_items;
+int start_items;
float start_ammo_shells;
float start_ammo_nails;
float start_ammo_rockets;
float want_weapon(entity weaponinfo, float allguns) // WEAPONTODO: what still needs done?
{
- float i = weaponinfo.weapon;
- float d = 0;
+ int i = weaponinfo.weapon;
+ int d = 0;
if (!i)
return 0;
for (i = WEP_FIRST; i <= WEP_LAST; ++i)
{
e = get_weaponinfo(i);
- float w = want_weapon(e, false);
+ int w = want_weapon(e, false);
if(w & 1)
start_weapons |= WepSet_FromWeapon(i);
if(w & 2)
for (i = WEP_FIRST; i <= WEP_LAST; ++i)
{
e = get_weaponinfo(i);
- float w = want_weapon(e, g_warmup_allguns);
+ int w = want_weapon(e, g_warmup_allguns);
if(w & 1)
warmup_start_weapons |= WepSet_FromWeapon(i);
if(w & 2)
void SetCustomizer(entity e, float(void) customizer, void(void) uncustomizer);
void Net_LinkEntity(entity e, float docull, float dt, float(entity, float) sendfunc);
-#endif
\ No newline at end of file
+#endif
.entity assault_sprite;
// legacy bot defs
-const float HAVOCBOT_AST_ROLE_NONE = 0;
-const float HAVOCBOT_AST_ROLE_DEFENSE = 2;
-const float HAVOCBOT_AST_ROLE_OFFENSE = 4;
+const int HAVOCBOT_AST_ROLE_NONE = 0;
+const int HAVOCBOT_AST_ROLE_DEFENSE = 2;
+const int HAVOCBOT_AST_ROLE_OFFENSE = 4;
-.float havocbot_role_flags;
+.int havocbot_role_flags;
.float havocbot_attack_time;
.void() havocbot_role;
// predefined spawnfuncs
void spawnfunc_func_breakable();
void target_objective_decrease_activate();
-#endif
\ No newline at end of file
+#endif
var float(string name) cvar;
var string(string name) cvar_string;
var void(string name, string value) cvar_set;
-#endif
\ No newline at end of file
+#endif
#define cvar builtin_cvar
#pragma noref 1
-#endif
\ No newline at end of file
+#endif
}
if(IS_REAL_CLIENT(other) || IS_BOT_CLIENT(other))
{
- float i;
- float found;
- found = false;
- for(i = 0; i < other.jumppadcount && i < NUM_JUMPPADSUSED; ++i)
+ bool found = false;
+ for(int i = 0; i < other.jumppadcount && i < NUM_JUMPPADSUSED; ++i)
if(other.(jumppadsused[i]) == self)
found = true;
if(!found)
return 1 + rint(n * 100.0 / d);
}
-float accuracy_send(entity to, float sf)
+float accuracy_send(entity to, int sf)
{
- float w, f;
+ int w, f;
entity a;
WriteByte(MSG_ENTITY, ENT_CLIENT_ACCURACY);
.float hit_time;
.float fired_time;
-void accuracy_add(entity e, float w, float fired, float hit)
+void accuracy_add(entity e, int w, float fired, float hit)
{
entity a;
float b;
.float csqcprojectile_type;
-float CSQCProjectile_SendEntity(entity to, float sf)
+float CSQCProjectile_SendEntity(entity to, int sf)
{
float ft, fr;
e.csqcprojectile_oldorigin = e.origin;
}
-void CSQCProjectile(entity e, float clientanimate, float type, float docull)
+void CSQCProjectile(entity e, float clientanimate, int type, float docull)
{
Net_LinkEntity(e, docull, 0, CSQCProjectile_SendEntity);
if(wpn == WEP_HOOK && !g_grappling_hook && autocvar_g_nades && !((cl.weapons | weaponsInMap) & WepSet_FromWeapon(wpn)))
complain = 0;
-
+
if(complain)
self.hasweapon_complain_spam = time + 0.2;
{
// We cannot tokenize in this function, as GiveItems calls this
// function. Thus we must use car/cdr.
- float weaponwant, first_valid, prev_valid, switchtonext, switchtolast, c;
- string rest;
+ float weaponwant, first_valid, prev_valid, switchtonext, switchtolast;
WepSet wepset = '0 0 0';
switchtonext = switchtolast = 0;
first_valid = prev_valid = 0;
if(dir == 0)
switchtonext = 1;
- c = 0;
+ int c = 0;
- rest = weaponorder;
+ string rest = weaponorder;
while(rest != "")
{
weaponwant = stof(car(rest)); rest = cdr(rest);
.float hasweapon_complain_spam;
float client_hasweapon(entity cl, float wpn, float andammo, float complain);
-.float weaponcomplainindex;
+.int weaponcomplainindex;
float W_GetCycleWeapon(entity pl, string weaponorder, float dir, float imp, float complain, float skipmissing);
#define w_getbestweapon(ent) W_GetCycleWeapon(ent, ent.cvar_cl_weaponpriority, 0, -1, false, true)
// previously used if exists and has ammo, (second) best otherwise
void W_LastWeapon(void);
-#endif
\ No newline at end of file
+#endif
{
replacement = "";
s = argv(i);
-
+
for(j = WEP_FIRST; j <= WEP_LAST; ++j)
{
e = get_weaponinfo(j);
string s;
entity oldself;
float i, j;
- float f;
+ int f;
if(self.classname != "droppedweapon" && self.classname != "replacedweapon")
{
//vector prevdir = w_shotdir;
//vector prevorg = w_shotorg;
- //vector prevend = w_shotend;
+ //vector prevend = w_shotend;
if (antilag)
if (!ent.cvar_cl_noantilag)
}
mspercallsum -= gettime(GETTIME_HIRES);
#endif
-
+
dir = W_CalculateSpread(dir, spread, g_weaponspreadfactor, autocvar_g_projectiles_spread_style);
-
+
#if 0
mspercallsum += gettime(GETTIME_HIRES);
mspercallcount += 1;
fireBullet_last_hit = world;
}
-void fireBullet(vector start, vector dir, float spread, float max_solid_penetration, float damage, float force, float dtype, float tracereffects)
+void fireBullet(vector start, vector dir, float spread, float max_solid_penetration, float damage, float force, float dtype, int tracereffects)
{
vector end;
float fireBullet_trace_callback_eff;
entity fireBullet_last_hit;
void fireBullet_trace_callback(vector start, vector hit, vector end);
-void fireBullet(vector start, vector dir, float spread, float max_solid_penetration, float damage, float force, float dtype, float tracereffects);
-#endif
\ No newline at end of file
+void fireBullet(vector start, vector dir, float spread, float max_solid_penetration, float damage, float force, float dtype, int tracereffects);
+#endif
void CL_Weaponentity_Think()
{
- float tb;
+ int tb;
self.nextthink = time;
if (intermission_running)
self.frame = self.anim_idle.x;