QCC ?= fteqcc
VERSION_MESSAGE = $(shell $(QCC) --version --help)
-ifneq (,$(findstring gmqcc,$(VERSION_MESSAGE)))
+ifneq (,$(findstring GMQCC,$(VERSION_MESSAGE)))
# this is gmqcc
QCCFLAGS_WATERMARK =
-QCCFLAGS ?= -Werror -Wall -Wno-field-redeclared -Wno-double-declaration -Wno-assign-function-types -Wno-unused-variable -std=fteqcc -fshort-logic -O1 -flno $(QCCFLAGS_EXTRA) $(QCCFLAGS_WATERMARK)
+QCCFLAGS ?= -Wall -Wno-field-redeclared -Wno-double-declaration -Wno-assign-function-types -Wno-unused-variable -std=fteqcc -fshort-logic -O1 -flno $(QCCFLAGS_EXTRA) $(QCCFLAGS_WATERMARK)
else
# this. is. fteqccccccccccccccccccc!
QCCFLAGS ?= -Werror -Wno-Q302 -O3 -Ono-return_only -fno-fastarrays $(QCCFLAGS_EXTRA) $(QCCFLAGS_WATERMARK)
isz_w = '1 0 0' + '0 1 0' * ((sz_y / sz_x) * (draw_scale_x / draw_scale_y));
isz_h = '0 1 0' + '1 0 0' * ((sz_x / sz_y) * (draw_scale_y / draw_scale_x));
+#ifdef GMQCC
+ isz = '0 0 0';
+#endif
switch(scalemode)
{
default:
{
// Should be touched
// dprint(self.netname, " found a touchable controlpoint at ", vtos(cp.origin) ,"\n");
+ found = FALSE;
// Look for auto generated waypoint
if not(bot_waypoints_for_items)
float waypoint_load_links()
{
string filename, s;
- float file, tokens, c, found;
- entity wp_from, wp_to;
+ float file, tokens, c = 0, found;
+ entity wp_from = world, wp_to;
vector wp_to_pos, wp_from_pos;
filename = strcat("maps/", mapname);
filename = strcat(filename, ".waypoints.cache");
wp_to_pos = stov(argv(1));
// Search "from" waypoint
- if(wp_from.origin!=wp_from_pos)
+ if(wp_from && wp_from.origin!=wp_from_pos)
{
wp_from = findradius(wp_from_pos, 1);
found = FALSE;
void waypoint_load_links_hardwired()
{
string filename, s;
- float file, tokens, c, found;
- entity wp_from, wp_to;
+ float file, tokens, c = 0, found;
+ entity wp_from = world, wp_to;
vector wp_to_pos, wp_from_pos;
filename = strcat("maps/", mapname);
filename = strcat(filename, ".waypoints.hardwired");
wp_to_pos = stov(argv(1));
// Search "from" waypoint
- if(wp_from.origin!=wp_from_pos)
+ if(wp_from && wp_from.origin!=wp_from_pos)
{
wp_from = findradius(wp_from_pos, 5);
found = FALSE;
for(i=0;i<32;++i)
{
// :S
+ link = world;
switch(i)
{
// for i in $(seq -w 0 31); do echo "case $i:link = w.wp$i; break;"; done;
- case 00:link = w.wp00; break;
- case 01:link = w.wp01; break;
- case 02:link = w.wp02; break;
- case 03:link = w.wp03; break;
- case 04:link = w.wp04; break;
- case 05:link = w.wp05; break;
- case 06:link = w.wp06; break;
- case 07:link = w.wp07; break;
- case 08:link = w.wp08; break;
- case 09:link = w.wp09; break;
+ case 0:link = w.wp00; break;
+ case 1:link = w.wp01; break;
+ case 2:link = w.wp02; break;
+ case 3:link = w.wp03; break;
+ case 4:link = w.wp04; break;
+ case 5:link = w.wp05; break;
+ case 6:link = w.wp06; break;
+ case 7:link = w.wp07; break;
+ case 8:link = w.wp08; break;
+ case 9:link = w.wp09; break;
case 10:link = w.wp10; break;
case 11:link = w.wp11; break;
case 12:link = w.wp12; break;
if (self.weaponentity)
{
self.weaponentity.wframe = fr;
+ a = '0 0 0';
if (fr == WFRAME_IDLE)
a = self.weaponentity.anim_idle;
else if (fr == WFRAME_FIRE1)
a = self.weaponentity.anim_fire1;
else if (fr == WFRAME_FIRE2)
a = self.weaponentity.anim_fire2;
- else if (fr == WFRAME_RELOAD)
+ else // if (fr == WFRAME_RELOAD)
a = self.weaponentity.anim_reload;
a_z *= g_weaponratefactor;
setanim(self.weaponentity, a, restartanim == FALSE, restartanim, restartanim);
}
// find default model
+#ifdef GMQCC
+ _model = string_null;
+#endif
if (self.itemkeys <= ITEM_KEY_BIT(2)) {
_model = "models/keys/key.md3";
} else if (self.itemkeys >= ITEM_KEY_BIT(3) && self.itemkeys <= ITEM_KEY_BIT(5)) {
string ctf_CaptureRecord(entity flag, entity player)
{
float cap_time, cap_record, success;
- string cap_message, refername;
+ string cap_message = string_null, refername;
if((autocvar_g_ctf_captimerecord_always) || (player_count - currentbots))
{
void ctf_CheckStalemate(void)
{
// declarations
- float stale_red_flags, stale_blue_flags;
+ float stale_red_flags = 0, stale_blue_flags = 0;
entity tmp_entity;
- entity ctf_staleflaglist; // reset the list, we need to build the list each time this function runs
+ entity ctf_staleflaglist = world; // reset the list, we need to build the list each time this function runs
// build list of stale flags
for(tmp_entity = ctf_worldflaglist; tmp_entity; tmp_entity = tmp_entity.ctf_worldflagnext)
// pass the flag to a team mate
if(autocvar_g_ctf_pass)
{
- entity head, closest_target;
+ entity head, closest_target = world;
head = WarpZone_FindRadius(player.origin, autocvar_g_ctf_pass_radius, TRUE);
while(head) // find the closest acceptable target to pass to
if(autocvar_g_onslaught_controlpoints_proxycap)
{
- float _enemy_count;
- float _friendly_count;
+ float _enemy_count = 0;
+ float _friendly_count = 0;
float _dist;
entity _player;
return 0;
float _close_to_home = ((random() > 0.5) ? TRUE : FALSE);
- entity _best, _trg_gen;
+ entity _best = world, _trg_gen = world;
float _score, _best_score = MAX_SHOT_DISTANCE;
RandomSelection_Init();
if(argv(1) == "help")
{
string _aspeco;
- _aspeco = strcat(_aspeco, "^7 superspec_itemfilter ^3\"item_classname1 item_classname2\"^7 only show thise items when ^2superspec ^3item_message^7 is on\n");
+ _aspeco = "^7 superspec_itemfilter ^3\"item_classname1 item_classname2\"^7 only show thise items when ^2superspec ^3item_message^7 is on\n";
_aspeco = strcat(_aspeco, "^3 clear^7 Remove the filter (show all pickups)\n");
_aspeco = strcat(_aspeco, "^3 show ^7 Display current filter\n");
superspec_msg("^3superspec_itemfilter help:\n\n\n", "\n^3superspec_itemfilter help:\n", self, _aspeco, 1);
}
float i;
float l = tokenize_console(self.superspec_itemfilter);
- string _msg;
+ string _msg = "";
for(i = 0; i < l; ++i)
_msg = strcat(_msg, "^3#", ftos(i), " ^7", argv(i), "\n");
//_msg = sprintf("^3#%d^7 %s\n%s", i, _msg, argv(i));
if(cmd_argc > 1)
{
- float i, _bits, _start = 1;
+ float i, _bits = 0, _start = 1;
if(argv(1) == "help")
{
- _aspeco = "";
- _aspeco = strcat(_aspeco, "use cmd superspec [option] [on|off] to set options\n\n");
+ _aspeco = "use cmd superspec [option] [on|off] to set options\n\n";
_aspeco = strcat(_aspeco, "^3 silent ^7(short^5 si^7) supress ALL mesagess from superspectate.\n");
_aspeco = strcat(_aspeco, "^3 verrbose ^7(short^5 ve^7) makes superspectate print some additional information.\n");
_aspeco = strcat(_aspeco, "^3 item_message ^7(short^5 im^7) makes superspectate print items that was picked up.\n");
}
+ _aspeco = "";
OPTIONINFO(self.superspec_flags, _aspeco, SSF_SILENT, "Silent", "silent", "si");
OPTIONINFO(self.superspec_flags, _aspeco, SSF_VERBOSE, "Verbose", "verbose", "ve");
OPTIONINFO(self.superspec_flags, _aspeco, SSF_ITEMMSG, "Item pickup messages", "item_message", "im");
{
if(argv(1) == "help")
{
- _aspeco = "";
- _aspeco = strcat(_aspeco, "use cmd autospec [option] [on|off] to set options\n\n");
+ _aspeco = "use cmd autospec [option] [on|off] to set options\n\n";
_aspeco = strcat(_aspeco, "^3 strength ^7(short^5 st^7) for automatic spectate on strength powerup\n");
_aspeco = strcat(_aspeco, "^3 shield ^7(short^5 sh^7) for automatic spectate on shield powerup\n");
_aspeco = strcat(_aspeco, "^3 mega_health ^7(short^5 mh^7) for automatic spectate on mega health\n");
return TRUE;
}
- float i, _bits, _start = 1;
+ float i, _bits = 0, _start = 1;
if(argv(1) == "clear")
{
self.autospec_flags = 0;
}
}
+ _aspeco = "";
OPTIONINFO(self.autospec_flags, _aspeco, ASF_STRENGTH, "Strength", "strength", "st");
OPTIONINFO(self.autospec_flags, _aspeco, ASF_SHIELD, "Shield", "shield", "sh");
OPTIONINFO(self.autospec_flags, _aspeco, ASF_MEGA_HP, "Mega Health", "mega_health", "mh");
return TRUE;
entity _player;
- float _team;
+ float _team = 0;
if(cmd_argc == 2)
{
{
// load object properties, and spawn a new object with them
float n, i;
- entity e, parent;
+ entity e = world, parent = world;
// separate objects between the ; symbols
n = tokenizebyseparator(s, "; ");
for(i = 0; i < n; ++i)
{
float argv_num;
- string tagname;
+ string tagname = string_null;
argv_num = 0;
tokenize_console(port_string[i]);
e = sandbox_ObjectSpawn(database);
float pathlib_makenode_adaptive(entity parent,vector start, vector to, vector goal,float cost)
{
entity node;
- float h,g,f,doedge;
+ float h,g,f,doedge = 0;
vector where;
++pathlib_searched_cnt;
entity curse1, rune1, curse2, rune2;
rcount = ccount = r = c = 0;
- rune = find(rune, classname, "rune");
+ rune = find(world, classname, "rune");
while(rune)
{
if(rune.owner == pl)
rcount = rcount + 1;
rune = find(rune, classname, "rune");
}
- curse = find(curse, classname, "curse");
+ curse = find(world, classname, "curse");
while(curse)
{
if(curse.owner == pl)
valueprefix = "max ";
}
else
+ {
error("invalid spawnflags");
+#ifdef GMQCC
+ itemprefix = string_null;
+ valueprefix = string_null;
+#endif
+ }
self.netname = "";
self.netname = sprintf("%s %s%d %s", self.netname, itemprefix, !!(self.items & IT_UNLIMITED_WEAPON_AMMO), "unlimited_weapon_ammo");
{
// FIXME: this cant be the best way to do this..
prep = pre_pos;
+#ifdef GMQCC
+ impact_time = 0;
+#endif
for(i = 0; i < 4; ++i)
{
distance = vlen(prep - self.tur_shotorg);
// Check if we have a vailid enemy, and try to find one if we dont.
// g_turrets_targetscan_maxdelay forces a target re-scan at least this often
- float do_target_scan;
+ float do_target_scan = 0;
if((self.target_select_time + autocvar_g_turrets_targetscan_maxdelay) < time)
do_target_scan = 1;
*/
float turret_stdproc_init (string cvar_base_name, string base, string head, float _turret_type)
{
- entity e, ee;
+ entity e, ee = world;
// Are turrets allowed?
if (autocvar_g_turrets == 0)
float turret_stdproc_targetscore_support(entity _turret,entity _target)
{
float score; // Total score
- float s_score, d_score;
+ float s_score = 0, d_score;
if (_turret.enemy == _target) s_score = 1;
float score; // Total score
float d_score; // Distance score
float a_score; // Angular score
- float m_score; // missile score
- float p_score; // player score
+ float m_score = 0; // missile score
+ float p_score = 0; // player score
float ikr; // ideal kill range
if (_turret.tur_defend)
float turret_tesla_firecheck()
{
// g_turrets_targetscan_maxdelay forces a target re-scan at least this often
- float do_target_scan;
+ float do_target_scan = 0;
if((self.target_select_time + autocvar_g_turrets_targetscan_maxdelay) < time)
do_target_scan = 1;
//if(self.animflag != ANIM_NO)
{
vector real_angle;
- float turny, turnx;
+ float turny = 0, turnx = 0;
float vz;
real_angle = vectoangles(self.steerto) - self.angles;
{
vector v;
- entity rocket;
+ entity rocket = world;
if (self.wait != -10)
{
void vehicles_showwp()
{
- entity oldself;
+ entity oldself = world;
vector rgb;
if(self.cnt)
void vehicles_reset_colors()
{
entity e;
- float _effects, _colormap;
+ float _effects = 0, _colormap;
vector _glowmod, _colormod;
if(autocvar_g_nodepthtestplayers)
- _effects = EF_NODEPTHTEST;
+ _effects |= EF_NODEPTHTEST;
if(autocvar_g_fullbrightplayers)
_effects |= EF_FULLBRIGHT;
float W_Crylink_Touch_WouldHitFriendly(entity projectile, float rad)
{
entity head = WarpZone_FindRadius((projectile.origin + (projectile.mins + projectile.maxs) * 0.5), rad + MAX_DAMAGEEXTRARADIUS, FALSE);
- float hit_friendly;
- float hit_enemy;
+ float hit_friendly = 0;
+ float hit_enemy = 0;
while(head)
{
{
if(autocvar_g_balance_electro_reload_ammo) // forced reload
{
+ ammo_amount = 0;
if(autocvar_g_balance_electro_lightning)
{
if(self.clip_load > 0)
// don't switch while guiding a missile
if (ATTACK_FINISHED(self) <= time || self.weapon != WEP_ROCKET_LAUNCHER)
{
+ ammo_amount = FALSE;
if(autocvar_g_balance_rocketlauncher_reload_ammo)
{
if(self.ammo_rockets < autocvar_g_balance_rocketlauncher_ammo && self.(weapon_load[WEP_ROCKET_LAUNCHER]) < autocvar_g_balance_rocketlauncher_ammo)
if(pl.movement_x > 0) movestate += 3;
if(pl.movement_y < 0) movestate -= 1;
if(pl.movement_y > 0) movestate += 1;
+#ifdef GMQCC
+ note = 0;
+#endif
switch(movestate)
{
// layout: originally I wanted
norm = normalize(norm);
}
+#ifdef GMQCC
+ ang = '0 0 0';
+#endif
if(self.aiment)
{
org = self.aiment.origin;