diff --git a/source/client/defs/custom.qc b/source/client/defs/custom.qc index 631b3f7..84b7f46 100644 --- a/source/client/defs/custom.qc +++ b/source/client/defs/custom.qc @@ -109,13 +109,6 @@ float sniper_hold_breath; float K_LEFTDOWN, K_RIGHTDOWN, K_BACKDOWN, K_FORWARDDOWN; -#define P_JUG 1 -#define P_DOUBLE 2 -#define P_SPEED 4 -#define P_REVIVE 8 -#define P_FLOP 16 -#define P_STAMIN 32 - vector TEXT_LIGHTBLUE = [0, 0.46, 0.70]; vector TEXT_ORANGE = [0.92, 0.74, 0]; vector TEXT_GREEN = [0, 0.90, 0.13]; diff --git a/source/menu/m_menu.qc b/source/menu/m_menu.qc index 5e200b9..7852025 100644 --- a/source/menu/m_menu.qc +++ b/source/menu/m_menu.qc @@ -260,7 +260,7 @@ float(float order, string id, string bsp_name, float usermap_index) Menu_MapButt } // Author/Description - if (user_maps[index].map_author) { + if (user_maps[index].map_author != "") { sui_set_align([SUI_ALIGN_CENTER, SUI_ALIGN_END]); string author = user_maps[index].map_author; diff --git a/source/menu/main.qc b/source/menu/main.qc index 9a7c5f2..9de0807 100644 --- a/source/menu/main.qc +++ b/source/menu/main.qc @@ -60,7 +60,7 @@ string UserMapNameLookup(string bsp_name) = if (user_maps[i].map_name != bsp_name) continue; - if (user_maps[i].map_name_pretty) + if (user_maps[i].map_name_pretty != "") return user_maps[i].map_name_pretty; return user_maps[i].map_name; diff --git a/source/server/ai/fte/waypoints_core.qc b/source/server/ai/fte/waypoints_core.qc index 13d7692..98bcc8f 100644 --- a/source/server/ai/fte/waypoints_core.qc +++ b/source/server/ai/fte/waypoints_core.qc @@ -564,7 +564,7 @@ void() Load_Waypoints { string line; line = fgets(file); - if not (line) { + if (line == "") { bprint(PRINT_HIGH, "End of file\n"); loop = 0; break; diff --git a/source/server/ai/pathfind_code.qc b/source/server/ai/pathfind_code.qc index 2e93d34..daa4584 100644 --- a/source/server/ai/pathfind_code.qc +++ b/source/server/ai/pathfind_code.qc @@ -380,7 +380,7 @@ void LoadWaypointData() { { string line; line = fgets(file); - if not (line) { + if (line == "") { //bprint(PRINT_HIGH, "End of file\n"); loop = 0; break; diff --git a/source/server/ai/standard/waypoints_func.qc b/source/server/ai/standard/waypoints_func.qc index e34b0eb..3323f0f 100644 --- a/source/server/ai/standard/waypoints_func.qc +++ b/source/server/ai/standard/waypoints_func.qc @@ -198,7 +198,7 @@ void() creator_way_touch = void () Create_New_Waypoint = { - float way_count; + float way_count = 0; float tempf; entity tempe; entity new_way; @@ -389,7 +389,7 @@ void () Link_Waypoints = active_way.target7 = current_way.waynum; active_way.target7 = strzone(active_way.target7); } - else if (active_way.target8) + else if (active_way.target8 != __NULL__) { active_way.target8 = current_way.waynum; active_way.target8 = strzone(active_way.target8); @@ -588,10 +588,11 @@ void () Select_Waypoint = } entity() closestDoor = { - local float bestdist,dist; + float bestdist; + float dist = 0; bestdist = 10000; - dist = 0; - local entity d,best; + entity d; + entity best = world; d = find(world,classname,"door_nzp"); while(d) { @@ -691,7 +692,7 @@ void (vector here, float which, string special, string trg, string trg2, string dprint ("\n"); //current_special++; } - if (trg) + if (trg != "") { new_way.target = trg; new_way.target = strzone(new_way.target); @@ -699,7 +700,7 @@ void (vector here, float which, string special, string trg, string trg2, string dprint (new_way.target); dprint ("\n"); } - if (trg2) + if (trg2 != "") { new_way.target2 = trg2; new_way.target2 = strzone(new_way.target2); @@ -707,7 +708,7 @@ void (vector here, float which, string special, string trg, string trg2, string dprint (new_way.target2); dprint ("\n"); } - if (trg3) + if (trg3 != "") { new_way.target3 = trg3; new_way.target3 = strzone(new_way.target3); @@ -715,7 +716,7 @@ void (vector here, float which, string special, string trg, string trg2, string dprint (new_way.target3); dprint ("\n"); } - if (trg4) + if (trg4 != "") { new_way.target4 = trg4; new_way.target4 = strzone(new_way.target4); @@ -723,7 +724,7 @@ void (vector here, float which, string special, string trg, string trg2, string dprint (new_way.target4); dprint ("\n"); } - if (trg5) + if (trg5 != "") { new_way.target5 = trg5; new_way.target5 = strzone(new_way.target5); @@ -731,7 +732,7 @@ void (vector here, float which, string special, string trg, string trg2, string dprint (new_way.target5); dprint ("\n"); } - if (trg6) + if (trg6 != "") { new_way.target6 = trg6; new_way.target6 = strzone(new_way.target6); @@ -739,7 +740,7 @@ void (vector here, float which, string special, string trg, string trg2, string dprint (new_way.target6); dprint ("\n"); } - if (trg7) + if (trg7 != "") { new_way.target7 = trg7; new_way.target7 = strzone(new_way.target7); @@ -747,7 +748,7 @@ void (vector here, float which, string special, string trg, string trg2, string dprint (new_way.target7); dprint ("\n"); } - if (trg8) + if (trg8 != "") { new_way.target8 = trg8; new_way.target8 = strzone(new_way.target8); diff --git a/source/server/defs/standard.qc b/source/server/defs/standard.qc index 4990ef7..073b5a5 100644 --- a/source/server/defs/standard.qc +++ b/source/server/defs/standard.qc @@ -348,12 +348,6 @@ void (entity who, float low_frequency, float high_frequency, float duration) #define CONTENT_LAVA -5 #define CONTENT_SKY -6 -//doors -#define STATE_TOP 0 -#define STATE_BOTTOM 1 -#define STATE_UP 2 -#define STATE_DOWN 3 - #define VEC_ORIGIN '0 0 0' // protocol bytes diff --git a/source/server/entities/doors.qc b/source/server/entities/doors.qc index 67145d8..efcbdfa 100644 --- a/source/server/entities/doors.qc +++ b/source/server/entities/doors.qc @@ -194,7 +194,7 @@ void() door_fire = self.message = string_null; // no more message oself = self; - if (self.door_model_target) + if (self.door_model_target != "") { entity tempe = find(world, classname, "func_door_model"); if (tempe != world) { @@ -485,7 +485,7 @@ void() LinkDoors = if (self.health) starte.health = self.health; - if (self.targetname) + if (self.targetname != "") starte.targetname = self.targetname; if (self.message != "") starte.message = self.message; diff --git a/source/server/entities/map_entities.qc b/source/server/entities/map_entities.qc index 0a87fb7..e486809 100644 --- a/source/server/entities/map_entities.qc +++ b/source/server/entities/map_entities.qc @@ -141,7 +141,7 @@ void() teddy_spawn = self.health = 0; self.th_die = teddy_react; - if (self.noise) + if (self.noise != "") precache_sound(self.noise); }; diff --git a/source/server/entities/mystery_box.qc b/source/server/entities/mystery_box.qc index 6d892b0..b0d656b 100644 --- a/source/server/entities/mystery_box.qc +++ b/source/server/entities/mystery_box.qc @@ -855,7 +855,7 @@ void(float mbox_file) MBOX_ParseMB2File = file_line = fgets(mbox_file); // End of file. - if not (file_line) { + if (file_line == "") { finished_parsing = true; break; } diff --git a/source/server/entities/pack_a_punch.qc b/source/server/entities/pack_a_punch.qc index de033d5..47bd1b7 100644 --- a/source/server/entities/pack_a_punch.qc +++ b/source/server/entities/pack_a_punch.qc @@ -190,7 +190,7 @@ void(entity pap, entity buyer) PAP_UpgradeWeapon = Sound_PlaySound(pap, pap.oldmodel, SOUND_TYPE_ENV_OBJECT, SOUND_PRIORITY_PLAYALWAYS); // Mapper-provided musical sting. - if (pap.powerup_vo) + if (pap.powerup_vo != "") Sound_PlaySound(pap, pap.powerup_vo, SOUND_TYPE_ENV_MUSIC, SOUND_PRIORITY_PLAYALWAYS); // @@ -425,7 +425,7 @@ void() perk_pap = precache_sound(self.oldmodel); - if (self.powerup_vo) + if (self.powerup_vo != "") precache_sound(self.powerup_vo); precache_sound("sounds/machines/papsound.wav"); diff --git a/source/server/entities/perk_a_cola.qc b/source/server/entities/perk_a_cola.qc index cef07f0..57ce2a9 100644 --- a/source/server/entities/perk_a_cola.qc +++ b/source/server/entities/perk_a_cola.qc @@ -427,7 +427,7 @@ void() setup_perk = Turn_PerkLight_On(self); // Perk Jingle Timer - if (self.powerup_vo) { + if (self.powerup_vo != "") { self.think = Perk_Jingle; self.nextthink = time + rint((random() * 30)) + 30; } @@ -510,8 +510,8 @@ float drink_skin, float perk_id) Perk_InitMachine = precache_sound(self.oldmodel); precache_sound("sounds/machines/vend.wav"); - if (self.aistatus) { precache_sound(self.aistatus); } - if (self.powerup_vo) { precache_sound(self.powerup_vo); } + if (self.aistatus != "") { precache_sound(self.aistatus); } + if (self.powerup_vo != "") { precache_sound(self.powerup_vo); } } // General Machine Setup diff --git a/source/server/entities/power_switch.qc b/source/server/entities/power_switch.qc index aff4f87..2c2fbb8 100644 --- a/source/server/entities/power_switch.qc +++ b/source/server/entities/power_switch.qc @@ -100,7 +100,7 @@ void() Power_Touch = Power_HandleFlip(); // Play the sound of the Power Switch flipping - if (self.powerup_vo) + if (self.powerup_vo != "") Sound_PlaySound(self, self.powerup_vo, SOUND_TYPE_ENV_OBJECT, SOUND_PRIORITY_PLAYALWAYS); isPowerOn = true; @@ -122,7 +122,7 @@ void() Power_Touch = self = old_self; } } - if (tempe.targetname) { + if (tempe.targetname != "") { old_self = self; self = tempe; remove(self); @@ -176,7 +176,7 @@ void() power_switch = self.box1 = '-4 0 12'; // Switch Flip Sound (Spatialized) - if (self.powerup_vo) + if (self.powerup_vo != "") precache_sound(self.powerup_vo); self.solid = SOLID_TRIGGER; diff --git a/source/server/entities/sub_functions.qc b/source/server/entities/sub_functions.qc index 3c7a735..9dfadc7 100644 --- a/source/server/entities/sub_functions.qc +++ b/source/server/entities/sub_functions.qc @@ -67,21 +67,21 @@ void() SUB_UseTargets = tempcount = 0; breakthis = false; - if (self.target) + if (self.target != "") tempcount = tempcount + 1; - if (self.target2) + if (self.target2 != "") tempcount = tempcount + 1; - if (self.target3) + if (self.target3 != "") tempcount = tempcount + 1; - if (self.target4) + if (self.target4 != "") tempcount = tempcount + 1; - if (self.target5) + if (self.target5 != "") tempcount = tempcount + 1; - if (self.target6) + if (self.target6 != "") tempcount = tempcount + 1; - if (self.target7) + if (self.target7 != "") tempcount = tempcount + 1; - if (self.target8) + if (self.target8 != "") tempcount = tempcount + 1; // @@ -163,7 +163,7 @@ void() SUB_UseTargets = // // fire targets // - if (tempstring) + if (tempstring != "") { act = activator; t = find (world, targetname, tempstring); diff --git a/source/server/entities/teleporter.qc b/source/server/entities/teleporter.qc index df6ba89..a75c4fa 100644 --- a/source/server/entities/teleporter.qc +++ b/source/server/entities/teleporter.qc @@ -326,7 +326,7 @@ void() teleport_touch = } if (other.button1) { - if (self.targetname) { + if (self.targetname != "") { if (self.nextthink < time) return; // not fired yet } diff --git a/source/server/entities/triggers.qc b/source/server/entities/triggers.qc index 28e9caa..6346bec 100644 --- a/source/server/entities/triggers.qc +++ b/source/server/entities/triggers.qc @@ -145,33 +145,33 @@ void() trigger_activator_touch = tempstring = ""; t = world; - if (self.target2) + if (self.target2 != "") tempcount =+ 1; - if (self.target3) + if (self.target3 != "") tempcount =+ 1; - if (self.target4) + if (self.target4 != "") tempcount =+ 1; - if (self.target5) + if (self.target5 != "") tempcount =+ 1; - if (self.target6) + if (self.target6 != "") tempcount =+ 1; - if (self.target7) + if (self.target7 != "") tempcount =+ 1; - if (self.target8) + if (self.target8 != "") tempcount =+ 1; - if (self.target2) + if (self.target2 != "") tempcount = tempcount + 1; - if (self.target3) + if (self.target3 != "") tempcount = tempcount + 1; - if (self.target4) + if (self.target4 != "") tempcount = tempcount + 1; - if (self.target5) + if (self.target5 != "") tempcount = tempcount + 1; - if (self.target6) + if (self.target6 != "") tempcount = tempcount + 1; - if (self.target7) + if (self.target7 != "") tempcount = tempcount + 1; - if (self.target8) + if (self.target8 != "") tempcount = tempcount + 1; while(tempcount > temptotal) @@ -193,7 +193,7 @@ void() trigger_activator_touch = tempstring = self.target7; if (temptotal == 8) tempstring = self.target8; - if (tempstring) + if (tempstring != "") { t = find (world, targetname, tempstring); breakthis = 0; @@ -230,7 +230,7 @@ void() trigger_interact_touch = return; if (Player_UseButtonPressed(other, self)) { - if (self.noise) + if (self.noise != "") Sound_PlaySound(other, self.noise, SOUND_TYPE_ENV_OBJECT, SOUND_PRIORITY_PLAYALWAYS); multi_trigger(); } @@ -254,7 +254,7 @@ void() teddy_react = if (t) Ent_FakeRemove(t); - } else if (self.target) { + } else if (self.target != "") { SUB_UseTargets(); } @@ -264,7 +264,7 @@ void() teddy_react = dummy.nextthink = time + 10; - if (self.noise) + if (self.noise != "") Sound_PlaySound(dummy, self.noise, SOUND_TYPE_ENV_OBJECT, SOUND_PRIORITY_PLAYALWAYS); Ent_FakeRemove(self); @@ -427,7 +427,7 @@ void() hurt_touch = self.nextthink = time + 1; } - if (self.message) + if (self.message != "") centerprint(other, strcat(self.message, "\n")); } diff --git a/source/server/main.qc b/source/server/main.qc index b67b077..00b1f2a 100644 --- a/source/server/main.qc +++ b/source/server/main.qc @@ -78,7 +78,7 @@ void() StartFrame = zent = find (world, classname, "waypoint"); while (zent) { - if (zent.targetname) + if (zent.targetname != "") setmodel(zent, "models/way/normal_way_door.spr"); else setmodel(zent, "models/way/normal_way.spr"); diff --git a/source/server/map_rotation.qc b/source/server/map_rotation.qc index 31fbed8..2b08437 100644 --- a/source/server/map_rotation.qc +++ b/source/server/map_rotation.qc @@ -86,7 +86,7 @@ void() MapRotation_SelectNextMap = while(load_loop) { // End of file, use the first map in the file. - if not (current_map) { + if (current_map == "") { load_loop = false; break; } diff --git a/source/server/rounds.qc b/source/server/rounds.qc index 2416e8e..898c494 100644 --- a/source/server/rounds.qc +++ b/source/server/rounds.qc @@ -259,7 +259,7 @@ void() NewRound = roundtype = 1; string fog_value; - if (world.fog) + if (world.fog != "") fog_value = strcat(world.fog, "\n"); else fog_value = "0 0 0 0 0\n"; diff --git a/source/server/utilities/game_restart.qc b/source/server/utilities/game_restart.qc index 30cfad5..d10c718 100644 --- a/source/server/utilities/game_restart.qc +++ b/source/server/utilities/game_restart.qc @@ -36,8 +36,6 @@ void(entity ent) MBOX_FreeEnt; entity() MBOX_GetFreeEnt; void() MBOX_Touch; -#define MBOX_SPAWNFLAG_NOLIGHT 2 - // // GameRestart_CleanPowerUps() // Cleans Power-Ups thrown about on the map, @@ -208,7 +206,7 @@ void() GameRestart_ResetMysteryBox = } // Spawn the Box Glow if permitted - if (!(mystery_box.spawnflags & MBOX_SPAWNFLAG_NOLIGHT)) { + if (!(mystery_box.spawnflags & 2)) { entity light = MBOX_GetFreeEnt(); light.classname = "mystery_glow"; original_box.goaldummy = light; diff --git a/source/shared/shared_defs.qc b/source/shared/shared_defs.qc index 126f6a6..65c2121 100644 --- a/source/shared/shared_defs.qc +++ b/source/shared/shared_defs.qc @@ -25,9 +25,6 @@ */ -#define true 1 -#define false 0 - // // CSQC Particle Types // @@ -109,11 +106,6 @@ #define SCREENFLASH_FADE_IN 1 #define SCREENFLASH_FADE_OUT 2 -// Define our FTE platform -#ifndef STANDARD -#define FTE -#endif // STANDARD - // Player Hull Sizes // 32x32x72 #define PLAYER_MINS_STANDING '-16 -16 -32' diff --git a/tools/qc-compiler-gnu.sh b/tools/qc-compiler-gnu.sh index 46a22ef..c1f6667 100755 --- a/tools/qc-compiler-gnu.sh +++ b/tools/qc-compiler-gnu.sh @@ -52,10 +52,10 @@ function compile_progs() function main() { setup; - compile_progs "csqc" "FTE CSQC" "-DFTE" - compile_progs "ssqc" "FTE SSQC" "-O3 -DFTE" - compile_progs "menu" "FTE MenuQC" "-O3 -DFTE" - compile_progs "ssqc" "Vril SSQC" "-O3" + compile_progs "csqc" "FTE CSQC" "-DFTE -Wall" + compile_progs "ssqc" "FTE SSQC" "-O3 -DFTE -Wall" + compile_progs "menu" "FTE MenuQC" "-O3 -DFTE -Wall" + compile_progs "ssqc" "Vril SSQC" "-O3 -Wall" exit ${RC} }