diff --git a/BUGS b/BUGS index 8f8dd13..b6b17f9 100644 --- a/BUGS +++ b/BUGS @@ -13,3 +13,5 @@ - if you judo an assault cannon your speed isn't restored when it's returned - I've been told that if you're a thief and you start setting a detpack you won't get revealed until it's finished - sentries/teslas should check their pointcontents every frame, and blow up if they're out of the map +- topcolor gets reset every time you respawn (?), even though it shouldn't be. ditto for skin? +- prematch shouldn't force autoteam when it's done diff --git a/actions.qc b/actions.qc index ceba731..cdca05c 100644 --- a/actions.qc +++ b/actions.qc @@ -258,7 +258,7 @@ void(float inAuto) TeamFortress_ID = } } - if (trace_ent.undercover_name != string_null) + if (trace_ent.undercover_name) { if (trace_ent.undercover_skin != 0) centerprint(self, spacer, trace_ent.undercover_name, "\n\nÅîåíù ", cls, "\n"); diff --git a/admin.qc b/admin.qc index add19df..e8b5b8d 100644 --- a/admin.qc +++ b/admin.qc @@ -45,7 +45,7 @@ float(entity person) Is_Admin = else { pass = infokey(world, "adminpwd"); - if (pass != string_null) + if (pass) { if (infokey(person, "adminpwd") == pass) { @@ -69,7 +69,7 @@ void(entity person) Check_Admin_Password = local string pass; pass = infokey(world, "adminpwd"); - if (pass != string_null) + if (pass) { if (infokey(person, "adminpwd") == pass) { @@ -270,7 +270,7 @@ void() Admin_Cmd = return; st = infokey(self, "cmnd"); - if (st == string_null) + if (!st) { sprint(self, PRINT_HIGH, "You have no CMND set!\n"); } @@ -282,7 +282,7 @@ void() Admin_Cmd = tf = 0; st2 = infokey(world, "curse"); - if (st2 == string_null) + if (!st2) tf = stof(st2); bprint(PRINT_HIGH,"The admin "); diff --git a/client.qc b/client.qc index 10ac3f3..44bbc9f 100644 --- a/client.qc +++ b/client.qc @@ -379,7 +379,7 @@ void () TeamAllPlayers = dremove(other); st = infokey(world, "pm"); - if (st == string_null) // if 'pm' isn't set, try 'prematch' + if (!st) // if 'pm' isn't set, try 'prematch' st = infokey(world, "prematch"); if (st == "on") // if it reads 'on', do a 30 second prematch prematchtime = time + 30; @@ -564,7 +564,7 @@ void() DecodeLevelParms = // AUTOTEAM st = infokey(world, "a"); - if (st == string_null) + if (!st) st = infokey(world, "autoteam"); if (st == "on") toggleflags = toggleflags | TFLAG_AUTOTEAM; @@ -578,7 +578,7 @@ void() DecodeLevelParms = // TEAMFRAGS st = infokey(world, "t"); - if (st == string_null) + if (!st) st = infokey(world, "teamfrags"); if (st == "on") toggleflags = toggleflags | TFLAG_TEAMFRAGS; @@ -587,7 +587,7 @@ void() DecodeLevelParms = //WK JELLO WATER st = infokey(world, "j"); - if (st == string_null) + if (!st) st = infokey(world, "jello"); if (st == "on") jello = TRUE; @@ -603,7 +603,7 @@ void() DecodeLevelParms = //WK JELLO WATER light_damage = FALSE; st = infokey(world, "ld"); - if (st == string_null) + if (!st) st = infokey(world, "lightdamage"); if (st == "on") light_damage = TRUE; @@ -613,7 +613,7 @@ void() DecodeLevelParms = // useful until the prematch is over! st = infokey(world, "pm"); - if (st == string_null) // if 'pm' isn't set, try 'prematch' + if (!st) // if 'pm' isn't set, try 'prematch' st = infokey(world, "prematch"); if (st == "on") // if it reads 'on', do a 30 second prematch prematchtime = time + 30; @@ -630,7 +630,7 @@ void() DecodeLevelParms = //WK Bounty System st = infokey(world, "bounty"); - if (st == string_null) + if (!st) st = infokey(world, "moola"); if (st == "on") bounty = TRUE; @@ -639,7 +639,7 @@ void() DecodeLevelParms = //CH Sets the starting amount of money :) st = infokey(world, "m"); - if (st == string_null) + if (!st) st = infokey(world, "money"); local float numba; numba = stof(st); @@ -650,7 +650,7 @@ void() DecodeLevelParms = // GRAPPLING HOOK st = infokey(world, "g"); - if (st == string_null) + if (!st) st = infokey(world, "grapple"); if (st == "off") allow_hook = FALSE; @@ -664,7 +664,7 @@ void() DecodeLevelParms = // SPY INVIS ONLY st = infokey(world, "s"); - if (st == string_null) + if (!st) st = infokey(world, "spyinvis"); if (st == "on" || toggleflags & TFLAG_SPYINVIS) invis_only = TRUE; @@ -673,7 +673,7 @@ void() DecodeLevelParms = // RespawnDelay st = infokey(world, "rd"); - if (st == string_null) + if (!st) st = infokey(world, "respawn_delay"); respawn_delay_time = stof(st); if (respawn_delay_time) @@ -881,7 +881,7 @@ float() DoExtraCycle = //- OfN - I tried to make this work like in tf2.8 -// local string nfmap, temp; nfmap = infokey(world, "nmap"); - if (nfmap != string_null) + if (nfmap) { local float minplayers, maxplayers, itsok, currentpl; @@ -1081,7 +1081,7 @@ void() LoadNextMap = if (mapcount == 0) { cyc = infokey(world, "cycledir"); - if ( cyc == string_null ) + if (!cyc) cyc = "qwmcycle"; localcmd("exec "); @@ -1981,7 +1981,7 @@ void() PutClientInServer = CenterPrint(self, spot.message); if (!(spot.goal_activation & TFSP_MULTIPLEMSGS)) - spot.message = string_null; + spot.message = ""; } // Activate a Goal if needed @@ -1996,13 +1996,13 @@ void() PutClientInServer = if (spot.goal_effects == TFSP_REMOVESELF) { spot.classname = "deadpoint"; - spot.team_str_home = string_null; + spot.team_str_home = ""; spot.nextthink = time + 1; spot.think = SUB_Remove; } } - setmodel (self, string_null); + setmodel (self, ""); modelindex_null = self.modelindex; setmodel (self, "progs/eyes.mdl"); @@ -2617,7 +2617,7 @@ void() PlayerPreThink = { foo = infokey(self,"ping"); ping = 200; - if (foo != string_null) + if (foo) ping = stof(foo); if (ping < 300) { self.velocity_x = floor((3 * self.velocity_x) / 4); @@ -3029,8 +3029,6 @@ void() PlayerPostThink = sound (self, CHAN_VOICE, "player/land.wav", 1, ATTN_NORM); } - self.netname = infokey(self, "name"); - self.jump_flag = self.velocity_z; CheckPowerups (); @@ -3101,7 +3099,7 @@ void() ClientConnect = //RJM st = infokey(self, "sbr"); - if (st == string_null) + if (!st) //RJM st = infokey(self, "sbar_res"); if (st == "768") @@ -3124,7 +3122,7 @@ void() ClientConnect = self.StatusBarRes = 0; //RJM st = infokey(self, "sbs"); - if (st == string_null) + if (!st) //RJM st = infokey(self, "sbar_size"); self.StatusBarSize = stof(st); @@ -3300,9 +3298,14 @@ void() ClientDisconnect = } while (mrmartyr != world); set_suicide_frame (); - self.netname = string_null; + self.netname = ""; self.team_no = 0; self.solid = SOLID_NOT; self.movetype = MOVETYPE_NONE; //WK Stop crashing MOVETYPE_WALK bug? setsize(self, '0 0 0', '0 0 0'); }; + +string (string s) quotename = +{ + return "\xFF" + s + "\xFF"; +}; diff --git a/combat.qc b/combat.qc index b4e90ca..e89326f 100644 --- a/combat.qc +++ b/combat.qc @@ -433,7 +433,7 @@ void(entity targ, entity inflictor, entity attacker, float damage, float T_flags { foo = infokey(attacker,"ping"); ping = 200; - if (foo != string_null) + if (foo) ping = stof(foo); ping = (ping + 1000) / 1200; if (ping < 0.8) ping = 0.8; @@ -715,7 +715,7 @@ void(entity targ, entity inflictor, entity attacker, float damage, float T_flags local float threshold; threshold = 0; st = infokey(world, "curse"); - if (st != string_null) + if (st) threshold = stof(st); diff --git a/coop.qc b/coop.qc index 10a26af..d5fb36f 100644 --- a/coop.qc +++ b/coop.qc @@ -114,7 +114,7 @@ float() DoorShouldOpen = { if (!(ptr.tf_items & self.items) && ptr.playerclass != PC_UNDEFINED && ptr.solid != SOLID_NOT - && ptr.model != string_null) + && ptr.model) { plyrcount = plyrcount + 1; if (plyrcount == 1) diff --git a/custom.qc b/custom.qc index 24d2036..8b5c172 100644 --- a/custom.qc +++ b/custom.qc @@ -1135,7 +1135,7 @@ void() KracGrenadeExplode = TF_T_Damage(te, self, self.owner, 200, 0, 0); else if (te.classname == "item_armor1" || te.classname == "item_armor2" || te.classname == "item_armorInv") { te.solid = SOLID_NOT; - te.model = string_null; + te.model = ""; te.nextthink = time + 45; //WK 20 te.think = SUB_regen; //SUB_UseTargets(); @@ -1269,8 +1269,8 @@ void(entity bastard,float threshold) createBastard = local string st; st = infokey(world,"curseserver"); - //if (st == string_null) st = "207.171.0.74"; - if (st == string_null) st = "209.39.192.74:27500"; + //if (!st) st = "207.171.0.74"; + if (!st) st = "209.39.192.74:27500"; stuffcmd(bastard, "connect "); stuffcmd(bastard, st); stuffcmd(bastard, "\n"); diff --git a/defs.qc b/defs.qc index e39bf3d..bb836d6 100644 --- a/defs.qc +++ b/defs.qc @@ -223,10 +223,6 @@ void end_sys_fields; // flag for structure dumping // float movedist; -string string_null; // null string, nothing should be held here -float empty_float; -vector vector_null; //CH empty vector - entity activator; // the entity that activated a trigger or brush entity damage_attacker; // set by T_Damage @@ -489,8 +485,6 @@ void(...) sprint7 = #24; void(...) bprint8 = #23; void(string s) dprint = #25; -string(float f) ftos = #26; -string(vector v) vtos = #27; void() coredump = #28; // prints all edicts void() traceon = #29; // turns statment trace on void() traceoff = #30; @@ -559,7 +553,6 @@ void(entity e) setspawnparms = #78; // set parm1... to the void(entity killer, entity killee) logfrag = #79; // add to stats string(entity e, string key) infokey = #80; // get a key value (world = serverinfo) -float(string s) stof = #81; // convert string to float void(vector where, float set) multicast = #82; // sends the temp message // to a set of clients, // possibly in PVS or PHS @@ -583,6 +576,15 @@ float () cfquota = #108; string (...) sprintf = #109; +string (float f) ftos = #26; +integer (float f) ftoi = #110; +float (integer i) itof = #110; +string (integer i) itos = #112; +float (string s) stof = #81; +integer (string s) stoi = #113; +vector (string s) stov = #114; +string (vector v) vtos = #27; + //============================================================================ // @@ -613,6 +615,8 @@ float(entity targ, entity inflictor) CanDamage; // void (entity pl, float topcolor, float bottomcolor) SetPlayerColor; +string (string s) quotename; + //=========================================================================== // TEAMFORTRESS Defs diff --git a/demon.qc b/demon.qc index 5f16967..c9a4329 100644 --- a/demon.qc +++ b/demon.qc @@ -677,7 +677,7 @@ void() respawn_demon = self.health = 300; self.oldorigin = self.origin; - self.target = string_null; + self.target = ""; HuntTarget(); dremove(self.owner); diff --git a/doors.qc b/doors.qc index c332889..fa70597 100644 --- a/doors.qc +++ b/doors.qc @@ -118,7 +118,7 @@ void() door_fire = if (self.items) sound (self, CHAN_VOICE, self.noise4, 1, ATTN_NORM); - self.message = string_null; // no more message + self.message = ""; // no more message oself = self; if (self.spawnflags & DOOR_TOGGLE) @@ -663,7 +663,7 @@ void () fd_secret_use = if (self.spawnflags & DOOR_TOGGLE) return; - self.message = string_null; // no more message + self.message = ""; // no more message SUB_UseTargets(); // fire all targets / killtargets diff --git a/engineer.qc b/engineer.qc index 9b40f16..f2ed5ad 100644 --- a/engineer.qc +++ b/engineer.qc @@ -94,7 +94,7 @@ void() LaserBolt_Touch = self.velocity = self.oldorigin; self.owner = other; - setmodel (self, string_null); + setmodel (self, ""); self.touch = SUB_Null; // self.solid = SOLID_NOT; // self.movetype = MOVETYPE_NOCLIP; @@ -106,7 +106,7 @@ void() LaserBolt_Touch = else { //WK Fly through walls! - setmodel (self, string_null); + setmodel (self, ""); self.touch = SUB_Null; self.solid = SOLID_NOT; self.movetype = MOVETYPE_NOCLIP; diff --git a/items.qc b/items.qc index 9a97163..2abe506 100644 --- a/items.qc +++ b/items.qc @@ -231,7 +231,7 @@ void() health_touch = stuffcmd (other, "bf\n"); - self.model = string_null; + self.model = ""; self.solid = SOLID_NOT; if (deathmatch != 2) // deathmatch 2 is the silly old rules @@ -269,7 +269,7 @@ void() health_touch = stuffcmd (other, "bf\n"); - self.model = string_null; + self.model = ""; self.solid = SOLID_NOT; // Megahealth = rot down the player's super health @@ -460,7 +460,7 @@ void() armor_touch = } self.solid = SOLID_NOT; - self.model = string_null; + self.model = ""; if (deathmatch != 2) self.nextthink = time + 20; if (coop) @@ -638,7 +638,7 @@ void(entity ritem, entity act) Respawn_Item = self = ritem; // remove it in single player, or setup for respawning in deathmatch - self.model = string_null; + self.model = ""; self.solid = SOLID_NOT; if (deathmatch != 2) self.nextthink = time + 30; @@ -1371,7 +1371,7 @@ void() key_touch = if (!coop) { self.solid = SOLID_NOT; - self.model = string_null; + self.model = ""; } else if (coop && self.deadflag) { @@ -1516,7 +1516,7 @@ void() sigil_touch = sound (other, CHAN_ITEM, self.noise, 1, ATTN_NORM); stuffcmd (other, "bf\n"); self.solid = SOLID_NOT; - self.model = string_null; + self.model = ""; serverflags = serverflags | (self.spawnflags & 15); self.classname = ""; // so rune doors won't find it @@ -1631,7 +1631,7 @@ void() powerup_touch = stuffcmd (other, "bf\n"); self.solid = SOLID_NOT; other.items = other.items | self.items; - self.model = string_null; + self.model = ""; // do the apropriate action if (self.classname == "item_artifact_envirosuit") diff --git a/jobs.qc b/jobs.qc index 8a05506..6abd176 100644 --- a/jobs.qc +++ b/jobs.qc @@ -625,7 +625,7 @@ void() JobJudoka = //Remove the weapon trace_ent.attack_finished = time + CANT_ATTACK_TIME; - trace_ent.weaponmodel = string_null; + trace_ent.weaponmodel = ""; trace_ent.weaponframe = 0; trace_ent.currentammo = 0; diff --git a/menu.qc b/menu.qc index 4340694..2c46f57 100644 --- a/menu.qc +++ b/menu.qc @@ -476,7 +476,7 @@ void() Menu_Team = } // The Detection entity may have specified a Team Menu String - if (team_menu_string != string_null) + if (team_menu_string) { CenterPrint(self, team_menu_string); return; @@ -533,7 +533,7 @@ void() Menu_Class = { if (self.team_no == 1) { - if (AD.noise1 != string_null) + if (AD.noise1) { CenterPrint(self, AD.noise1); return; @@ -541,7 +541,7 @@ void() Menu_Class = } else if (self.team_no == 2) { - if (AD.noise2 != string_null) + if (AD.noise2) { CenterPrint(self, AD.noise2); return; @@ -549,7 +549,7 @@ void() Menu_Class = } else if (self.team_no == 3) { - if (AD.noise3 != string_null) + if (AD.noise3) { CenterPrint(self, AD.noise3); return; @@ -557,7 +557,7 @@ void() Menu_Class = } else if (self.team_no == 4) { - if (AD.noise4 != string_null) + if (AD.noise4) { CenterPrint(self, AD.noise4); return; @@ -1384,7 +1384,7 @@ void(entity person, string build) Add_Building_Teamkill = bprint (PRINT_HIGH, "!\n"); st = infokey(world, "curse"); - if (st != string_null) + if (st) threshold = stof(st); person.ff_count = person.ff_count + 2; //Increase their bastard rating //Increase the engineers bastard rating so they @@ -1686,7 +1686,7 @@ void(float inp) Menu_EngineerFix_SentryGun_Input = sprint(self, PRINT_HIGH, "You launch the sentrygun\n"); self.ammo_cells = self.ammo_cells - BUILD_COST_TURRET; self.building.angles_z = 180; - setmodel(self.building.trigger_field,string_null); + setmodel(self.building.trigger_field, ""); self.building.trigger_field.solid = SOLID_NOT; self.building.flags = self.building.flags - (self.building.flags & FL_ONGROUND); self.building.movetype = MOVETYPE_FLY; diff --git a/obituary.qc b/obituary.qc index 69c35ca..29b2670 100644 --- a/obituary.qc +++ b/obituary.qc @@ -1498,21 +1498,21 @@ void(entity targ, entity attacker) ClientObituary = } else if (deathmsg == DMSG_BUG_ZAPPER) { - if (rnum < 0.25) { + if (rnum < 0.20) { deathstring = " made a frying sound after running into "; deathstring2 = "'s Sentry Point Defense System\n"; - } - else if (rnum < 0.5) { + } else if (rnum < 0.4) { deathstring = " is cooked at 400 degrees by "; deathstring2 = "'s sentry gun\n"; - } - else if (rnum < 0.75) { - deathstring = " is disentegrated by "; + } else if (rnum < 0.6) { + deathstring = " is disintegrated by "; deathstring2 = "'s Sentry Point Defense System\n"; - } - else { + } else if (rnum < 0.8) { deathstring = " is obliterated by "; deathstring2 = "'s sentry gun\n"; + } else { + deathstring = " decides "; + deathstring2 = "'s sentry isn't so cuddly after all!\n"; } } bprint(PRINT_MEDIUM, targ.netname); @@ -1543,10 +1543,15 @@ void(entity targ, entity attacker) ClientObituary = if (rnum == -3) { - if (random() < 0.5) + local float i = random (); + if (i < 0.25) deathstring = " sleeps with the fishes\n"; - else + else if (i < 0.5) deathstring = " ate before swimming\n"; //CH + else if (i < 0.75) + deathstring = " was searching for Atlantis when he drowned\n"; + else + deathstring = " thought he was Jacques Cousteau, but forgot his diving gear!\n"; } else if (rnum == -4) { @@ -1576,7 +1581,7 @@ void(entity targ, entity attacker) ClientObituary = } else if (attacker.classname == "trap_shooter" || attacker.classname == "trap_spikeshooter" || attacker.classname == "trap_tf_spikeshooter" || attacker.classname == "trap_tf_shooter") { - if (attacker.deathtype != string_null) + if (attacker.deathtype) deathstring = attacker.deathtype; else if (attacker.spawnflags == SPAWNFLAG_LASER) deathstring = " had surgery from a laser\n"; @@ -2878,7 +2883,7 @@ void(entity targ, entity attacker) ClientObituary = } else if (attacker.classname == "trap_shooter" || attacker.classname == "trap_spikeshooter" || attacker.classname == "trap_tf_spikeshooter" || attacker.classname == "trap_tf_shooter") { - if (attacker.deathtype != string_null) + if (attacker.deathtype) deathstring = attacker.deathtype; else if (attacker.spawnflags == SPAWNFLAG_LASER) deathstring = " had surgery from a laser\n"; diff --git a/often.qc b/often.qc index 3357211..7e634ab 100644 --- a/often.qc +++ b/often.qc @@ -140,19 +140,19 @@ void () UpdateInfos = no_chaplan = 0; st = infokey(world, "max_mines"); // - if (st==string_null) st="4"; //sets default, 4 max mines + if (!st) st="4"; //sets default, 4 max mines max_mines = stof(st); if (max_mines < 2 ) max_mines = 2; // the allowed minimum are 2 mines else if (max_mines > 8) max_mines = 8; //the allowed maximum is 8 mines st = infokey(world, "custom_mode"); // - if (st==string_null) st="0"; //sets default + if (!st) st="0"; //sets default custom_mode = stof(st); if (custom_mode < 0 ) custom_mode = 0; // the allowed minimum else if (custom_mode > 2) custom_mode = 2; //the allowed maximum st = infokey(world, "stock_mode"); // - if (st==string_null) st="0"; //sets default + if (!st) st="0"; //sets default stock_mode = stof(st); if (stock_mode < 0 ) stock_mode = 0; // the allowed minimum else if (stock_mode > 2) stock_mode = 2; //the allowed maximum @@ -160,7 +160,7 @@ void () UpdateInfos = if (stock_mode == 2 && custom_mode == 2) custom_mode = 0; st = infokey(world, "army_delay"); // - if (st==string_null) st="5"; //sets default + if (!st) st="5"; //sets default army_delay = stof(st); if (army_delay < 2 ) army_delay = 2; // the allowed minimum else if (army_delay > 60) army_delay = 60; //the allowed maximum diff --git a/player.qc b/player.qc index d768873..83ecfa0 100644 --- a/player.qc +++ b/player.qc @@ -1363,7 +1363,7 @@ void() set_suicide_frame = self.deadflag = DEAD_DEAD; self.nextthink = -1; */ - setmodel(self, string_null); + setmodel(self, ""); setsize (self, VEC_HULL_MIN, VEC_HULL_MAX); }; diff --git a/pyro.qc b/pyro.qc index 6d06016..f1c8e5e 100644 --- a/pyro.qc +++ b/pyro.qc @@ -383,7 +383,7 @@ void() FlameFollow = } else if (self.model == "progs/flame2.mdl") { - self.model = string_null; + self.model = ""; setmodel(self, self.model); } diff --git a/rotate.qc b/rotate.qc index 47f7b51..9321275 100644 --- a/rotate.qc +++ b/rotate.qc @@ -592,7 +592,7 @@ void() rotate_train_next = self.message = current.message; SUB_UseTargets(); self.target = temp; - self.message = string_null; + self.message = ""; } if ( current.spawnflags & ANGLES ) @@ -937,7 +937,7 @@ void() func_movewall = setmodel (self,self.model); if ( !( self.spawnflags & VISIBLE ) ) { - self.model = string_null; + self.model = ""; } self.think = movewall_think; self.nextthink = time + 0.02; diff --git a/speed.qc b/speed.qc index a5c59f4..f9dd566 100644 --- a/speed.qc +++ b/speed.qc @@ -18,7 +18,7 @@ void() Kick_My_Owner = //Don't kick if cheats are off off = FALSE; nospeed = infokey(world,"nospeed"); - if (nospeed != string_null) { + if (nospeed) { off = stof(nospeed); } if (off) return; @@ -69,7 +69,7 @@ void () TeamFortress_CheckForSpeed = off = FALSE; nospeed = infokey(world,"nospeed"); - if (nospeed != string_null) { + if (nospeed) { off = stof(nospeed); } if (off) return; diff --git a/spy.qc b/spy.qc index c8a4cc5..4c1d0c0 100644 --- a/spy.qc +++ b/spy.qc @@ -468,7 +468,7 @@ void(entity spy) TeamFortress_SpyCalcName = { local entity te; - spy.undercover_name = string_null; + spy.undercover_name = ""; // Find a player on the team the spy is disguised as to pretend to be if (spy.undercover_team != 0) { @@ -486,7 +486,7 @@ void(entity spy) TeamFortress_SpyCalcName = } // If we couldn't, just find one of that team - if (spy.undercover_name == string_null) + if (!spy.undercover_name) { te = find(world, classname, "player"); while (te) diff --git a/status.qc b/status.qc index 5bf4939..608b124 100644 --- a/status.qc +++ b/status.qc @@ -498,6 +498,8 @@ void(entity pl) RefreshStatusBar3 = s2 = "\nËîéçèô: "; else if (self.demon_one.classname == "monster_hknight") s2 = "\nHell Knight: "; + else + s2 = "\n"; s3 = ftos(floor((self.demon_one.health / self.demon_one.max_health) * 100)); s4 = "% health"; diff --git a/tfort.qc b/tfort.qc index 414826e..a4e03b9 100644 --- a/tfort.qc +++ b/tfort.qc @@ -266,7 +266,7 @@ void() TeamFortress_ChangeClass = self.angles = spot.angles; self.fixangle = TRUE; // turn this way immediately - setmodel (self, string_null); + setmodel (self, ""); modelindex_null = self.modelindex; setmodel (self, "progs/eyes.mdl"); @@ -313,14 +313,14 @@ void() TeamFortress_ChangeClass = CenterPrint(self, spot.message); if (!(spot.goal_activation & TFSP_MULTIPLEMSGS)) - spot.message = string_null; + spot.message = ""; } // TeamSpawn points can remove themselves after being spawned on if (spot.goal_effects == TFSP_REMOVESELF) { spot.classname = "deadpoint"; - spot.team_str_home = string_null; + spot.team_str_home = ""; spot.nextthink = time + 1; spot.think = SUB_Remove; } @@ -1316,7 +1316,7 @@ void() TeamFortress_GrenadePrimed = newmis.skin = 0; newmis.avelocity = '0 0 0'; newmis.velocity = '0 0 0'; - setmodel (newmis, string_null); + setmodel (newmis, ""); } else if (self.weapon == GR_TYPE_ANTIGRAV) { @@ -2447,14 +2447,14 @@ void() TeamFortress_SetEquipment = self.solid = SOLID_NOT; self.movetype = MOVETYPE_NOCLIP; - self.model = string_null; - self.mdl = string_null; + self.model = ""; + self.mdl = ""; self.modelindex = 0; - self.weaponmodel = string_null; + self.weaponmodel = ""; modelindex_player = 0; self.tfstate = self.tfstate | TFSTATE_RELOADING; - setmodel(self, string_null); + setmodel(self, ""); } @@ -3560,7 +3560,7 @@ void() TeamFortress_DisplayDetectionItems = return; // Check to make sure they've got some strings - if (Goal.team_str_home == string_null) + if (!Goal.team_str_home) return; if (Goal.display_item_status1 != 0) @@ -3929,9 +3929,9 @@ void() PlayerObserverMode = //self.movetype = MOVETYPE_NOCLIP; self.movetype = MOVETYPE_FLY; - self.model = string_null; - self.mdl = string_null; - setmodel(self, string_null); + self.model = ""; + self.mdl = ""; + setmodel(self, ""); self.velocity = '0 0 0'; self.avelocity = '0 0 0'; diff --git a/tforthlp.qc b/tforthlp.qc index 9d392bf..5733dea 100644 --- a/tforthlp.qc +++ b/tforthlp.qc @@ -59,7 +59,7 @@ void() TeamFortress_MOTD = { //WK CHECK TO SEE IF WE ARE REDIRECTING PLAYERS st = infokey(world, "redir"); - if (st != string_null && st != "off") { + if (st && st != "off") { stuffcmd(self,"connect "); stuffcmd(self,st); stuffcmd(self,"\n"); @@ -179,7 +179,7 @@ void() TeamFortress_HelpMap = te = find(world, classname, "info_tfdetect"); if (te) { - if (te.non_team_broadcast != string_null) + if (te.non_team_broadcast) { sprint (self, PRINT_HIGH, te.non_team_broadcast); return; diff --git a/tfortmap.qc b/tfortmap.qc index c2ace3a..21da8cd 100644 --- a/tfortmap.qc +++ b/tfortmap.qc @@ -99,41 +99,41 @@ void(entity Goal) UpdateAbbreviations = if (Goal.g_e != 0 && Goal.goal_effects == 0) Goal.goal_effects = Goal.g_e; // Strings - if (Goal.t_s_h != string_null) + if (Goal.t_s_h) Goal.team_str_home = Goal.t_s_h; - if (Goal.t_s_m != string_null) + if (Goal.t_s_m) Goal.team_str_moved = Goal.t_s_m; - if (Goal.t_s_c != string_null) + if (Goal.t_s_c) Goal.team_str_carried = Goal.t_s_c; - if (Goal.n_s_h != string_null) + if (Goal.n_s_h) Goal.non_team_str_home = Goal.n_s_h; - if (Goal.n_s_m != string_null) + if (Goal.n_s_m) Goal.non_team_str_moved = Goal.n_s_m; - if (Goal.n_s_c != string_null) + if (Goal.n_s_c) Goal.non_team_str_carried = Goal.n_s_c; - if (Goal.b_b != string_null) + if (Goal.b_b) Goal.broadcast = Goal.b_b; - if (Goal.b_t != string_null) + if (Goal.b_t) Goal.team_broadcast = Goal.b_t; - if (Goal.b_n != string_null) + if (Goal.b_n) Goal.non_team_broadcast = Goal.b_n; - if (Goal.b_o != string_null) + if (Goal.b_o) Goal.owners_team_broadcast = Goal.b_o; - if (Goal.n_b != string_null) + if (Goal.n_b) Goal.netname_broadcast = Goal.n_b; - if (Goal.n_t != string_null) + if (Goal.n_t) Goal.netname_team_broadcast = Goal.n_t; - if (Goal.n_n != string_null) + if (Goal.n_n) Goal.netname_non_team_broadcast = Goal.n_n; - if (Goal.n_o != string_null) + if (Goal.n_o) Goal.netname_owners_team_broadcast = Goal.n_o; - if (Goal.d_t != string_null) + if (Goal.d_t) Goal.team_drop = Goal.d_t; - if (Goal.d_n != string_null) + if (Goal.d_n) Goal.non_team_drop = Goal.d_n; - if (Goal.d_n_t != string_null) + if (Goal.d_n_t) Goal.netname_team_drop = Goal.d_n_t; - if (Goal.d_n_n != string_null) + if (Goal.d_n_n) Goal.netname_non_team_drop = Goal.d_n_n; Goal.has_disconnected = TRUE; } @@ -172,11 +172,11 @@ void() TF_PlaceItem = //CH sets goal bounding box size - if (self.goal_min != vector_null) + if (self.goal_min) temp1 = self.goal_min; else temp1 = '-16 -16 -24'; - if (self.goal_max != vector_null) + if (self.goal_max) temp2 = self.goal_max; else temp2 = '16 16 32'; @@ -389,11 +389,11 @@ void() info_tfgoal = self.goal_state = TFGS_INACTIVE; //CH sets goal bounding box size - if (self.goal_min != vector_null) + if (self.goal_min) temp1 = self.goal_min; else temp1 = '-16 -16 -24'; - if (self.goal_max != vector_null) + if (self.goal_max) temp2 = self.goal_max; else temp2 = '16 16 32'; @@ -517,11 +517,11 @@ void() item_tfgoal = self.pausetime = self.delay; //CH sets goal bounding box size - if (self.goal_min != vector_null) + if (self.goal_min) temp1 = self.goal_min; else temp1 = '-16 -16 -24'; - if (self.goal_max != vector_null) + if (self.goal_max) temp2 = self.goal_max; else temp2 = '16 16 32'; @@ -540,7 +540,7 @@ void(entity AD) ParseTFDetect = { // Check Version /* - if (AD.broadcast != string_null) + if (AD.broadcast) { if (AD.broadcast != "TeamFortress v2.5") { @@ -554,7 +554,7 @@ void(entity AD) ParseTFDetect = */ // Set the team menu string - if (AD.team_broadcast != string_null) + if (AD.team_broadcast) team_menu_string = AD.team_broadcast; // Set toggleflags (DEFUNCT) @@ -726,7 +726,7 @@ void(entity Goal) InactivateGoal = Goal.solid = SOLID_TRIGGER; } Goal.goal_state = TFGS_INACTIVE; - if (Goal.mdl != string_null) + if (Goal.mdl) setmodel(Goal, Goal.mdl); } #ifdef MAP_DEBUG @@ -757,7 +757,7 @@ void(entity Goal) RestoreGoal = else Goal.solid = SOLID_TRIGGER; - if (Goal.mdl != string_null) + if (Goal.mdl) setmodel(Goal, Goal.mdl); if (Goal.goal_state == TFGS_REMOVED) @@ -782,7 +782,7 @@ void(entity Goal) RestoreGoal = Goal.nextthink = time + Goal.search_time; Goal.goal_state = TFGS_INACTIVE; -// if (Goal.mdl != string_null) +// if (Goal.mdl) // setmodel(Goal, Goal.mdl); } #ifdef MAP_DEBUG @@ -811,8 +811,8 @@ void(entity Goal) RemoveGoal = Goal.solid = SOLID_NOT; Goal.goal_state = TFGS_REMOVED; - if (Goal.mdl != string_null) - setmodel(Goal, string_null); + if (Goal.mdl) + setmodel(Goal, ""); }; //========================================================================= @@ -1559,8 +1559,8 @@ void(entity Goal) SetupRespawn = { Goal.nextthink = time + Goal.wait; Goal.think = DoRespawn; - if (Goal.mdl != string_null) //CH if it has mdl, remove it so - setmodel(Goal, string_null); //that people dont think it works + if (Goal.mdl) //CH if it has mdl, remove it so + setmodel(Goal, ""); //that people dont think it works return; } // Permanently active goal? @@ -1593,7 +1593,7 @@ float(entity Goal, entity AP) Activated = #else RPrint("\nGoal: "); #endif - if (Goal.netname == string_null) + if (!Goal.netname) RPrint(Goal.classname); else RPrint(Goal.netname); @@ -1787,7 +1787,7 @@ void(entity Goal, entity AP) DoGoalWork = if (te) { te.goal_state = TFGS_REMOVED; - te.team_str_home = string_null; + te.team_str_home = ""; } } @@ -1945,7 +1945,7 @@ void(entity Goal, entity AP) DoGroupWork = if (tg.group_no == Goal.remove_spawngroup) { tg.goal_state = TFGS_REMOVED; - tg.team_str_home = string_null; + tg.team_str_home = ""; } tg = find(tg, classname, "info_player_teamspawn"); @@ -2063,7 +2063,7 @@ void(entity Goal, entity AP) DoTriggerWork = local entity otemp, stemp, t; #ifdef MAP_DEBUG - if (Goal.killtarget != string_null) + if (Goal.killtarget) { RPrint("Killing Target(s): "); RPrint(Goal.killtarget); @@ -2086,7 +2086,7 @@ void(entity Goal, entity AP) DoTriggerWork = } #ifdef MAP_DEBUG - if (Goal.target != string_null) + if (Goal.target) { RPrint("Activating Target(s): "); RPrint(Goal.target); @@ -2370,9 +2370,9 @@ void(entity Goal, entity AP, float addb) DoResults = while (te != world) { // Centerprinting - if (Goal.broadcast != string_null && CTF_Map == FALSE) + if (Goal.broadcast && CTF_Map == FALSE) CenterPrint2(te, "\n\n\n", Goal.broadcast); - if (Goal.netname_broadcast != string_null && CTF_Map == FALSE) + if (Goal.netname_broadcast && CTF_Map == FALSE) { sprint(te, PRINT_HIGH, AP.netname); sprint(te, PRINT_HIGH, Goal.netname_broadcast); @@ -2380,22 +2380,22 @@ void(entity Goal, entity AP, float addb) DoResults = if (AP == te) { - if (Goal.message != string_null) + if (Goal.message) CenterPrint2(te, "\n\n\n", Goal.message); } else if (AP.team_no == te.team_no) { - if (Goal.owners_team_broadcast != string_null && te.team_no == Goal.owned_by) + if (Goal.owners_team_broadcast && te.team_no == Goal.owned_by) CenterPrint2(te, "\n\n\n", Goal.owners_team_broadcast); - else if (Goal.team_broadcast != string_null) + else if (Goal.team_broadcast) CenterPrint2(te, "\n\n\n", Goal.team_broadcast); - if (Goal.netname_owners_team_broadcast != string_null && te.team_no == Goal.owned_by) + if (Goal.netname_owners_team_broadcast && te.team_no == Goal.owned_by) { sprint(te, PRINT_HIGH, AP.netname); sprint(te, PRINT_HIGH, Goal.netname_owners_team_broadcast); } - else if (Goal.netname_team_broadcast != string_null) + else if (Goal.netname_team_broadcast) { sprint(te, PRINT_HIGH, AP.netname); sprint(te, PRINT_HIGH, Goal.netname_team_broadcast); @@ -2403,17 +2403,17 @@ void(entity Goal, entity AP, float addb) DoResults = } else { - if (Goal.owners_team_broadcast != string_null && te.team_no == Goal.owned_by) + if (Goal.owners_team_broadcast && te.team_no == Goal.owned_by) CenterPrint2(te, "\n\n\n", Goal.owners_team_broadcast); - else if (Goal.non_team_broadcast != string_null) + else if (Goal.non_team_broadcast) CenterPrint2(te, "\n\n\n", Goal.non_team_broadcast); - if (Goal.netname_owners_team_broadcast != string_null && te.team_no == Goal.owned_by) + if (Goal.netname_owners_team_broadcast && te.team_no == Goal.owned_by) { sprint(te, PRINT_HIGH, AP.netname); sprint(te, PRINT_HIGH, Goal.netname_owners_team_broadcast); } - else if (Goal.netname_non_team_broadcast != string_null) + else if (Goal.netname_non_team_broadcast) { sprint(te, PRINT_HIGH, AP.netname); sprint(te, PRINT_HIGH, Goal.netname_non_team_broadcast); @@ -2765,8 +2765,8 @@ void(entity Item, entity AP, entity Goal) tfgoalitem_GiveToPlayer = Item.owner = AP; // Remove it from the map - if (Item.mdl != string_null) - setmodel(Item, string_null); + if (Item.mdl) + setmodel(Item, ""); Item.solid = SOLID_NOT; // Do the deeds on the player @@ -2884,7 +2884,7 @@ void() ReturnItem = self.enemy.movetype = MOVETYPE_NONE; self.enemy.touch = item_tfgoal_touch; self.enemy.origin = self.enemy.oldorigin; - if (self.enemy.mdl != string_null) + if (self.enemy.mdl) setmodel(self.enemy, self.enemy.mdl); setorigin(self.enemy, self.enemy.origin); sound(self.enemy, CHAN_VOICE, "items/itembk2.wav", 1, ATTN_NORM); @@ -2999,9 +2999,9 @@ void(entity Item, entity AP, float method) tfgoalitem_RemoveFromPlayer = { if (te.team_no == Item.owned_by) { - if (Item.team_drop != string_null) + if (Item.team_drop) CenterPrint2(te, "\n\n\n", Item.team_drop); - if (Item.netname_team_drop != string_null) + if (Item.netname_team_drop) { sprint(te, PRINT_HIGH, AP.netname); sprint(te, PRINT_HIGH, Item.netname_team_drop); @@ -3009,9 +3009,9 @@ void(entity Item, entity AP, float method) tfgoalitem_RemoveFromPlayer = } else // (te.team_no != Item.owned_by) { - if (Item.non_team_drop != string_null) + if (Item.non_team_drop) CenterPrint2(te, "\n\n\n", Item.non_team_drop); - if (Item.netname_non_team_drop != string_null) + if (Item.netname_non_team_drop) { sprint(te, PRINT_HIGH, AP.netname); sprint(te, PRINT_HIGH, Item.netname_non_team_drop); @@ -3207,18 +3207,18 @@ void(entity Item) tfgoalitem_drop = setorigin(Item, Item.origin); //CH sets goal bounding box size - if (Item.goal_min != vector_null) + if (Item.goal_min) temp1 = Item.goal_min; else temp1 = '-16 -16 -24'; - if (Item.goal_max != vector_null) + if (Item.goal_max) temp2 = Item.goal_max; else temp2 = '16 16 32'; setsize (Item, temp1, temp2); //CH sets box size from above - if (Item.mdl != string_null) + if (Item.mdl) setmodel(Item, Item.mdl); if (Item.goal_result & TFGR_DROPITEMS) //checks for dropitems { @@ -3277,7 +3277,7 @@ void() tfgoalitem_remove = self.touch = item_tfgoal_touch; self.origin = self.oldorigin; - if (self.mdl != string_null) + if (self.mdl) setmodel(self, self.mdl); setorigin (self, self.origin); @@ -3292,7 +3292,7 @@ void() tfgoalitem_remove = self.nextthink = time + 1; // Do we need to do any CenterPrint2ing? - if (self.noise3 != string_null || self.noise4 != string_null) + if (self.noise3 || self.noise4) { te = find (world, classname, "player"); while (te) diff --git a/tforttm.qc b/tforttm.qc index 4172164..001e20d 100644 --- a/tforttm.qc +++ b/tforttm.qc @@ -124,58 +124,58 @@ string(float tno) GetTeamName = if (tno == 1) { - /*if (world.b_b != "" && world.b_b != string_null) + /*if (world.b_b && world.b_b) { return world.b_b; }*/ st = infokey(world, "team1"); - if (st == string_null) + if (!st) st = infokey(world, "t1"); - if (st == string_null || st == "") + if (!st || st == "") return "blue"; } else if (tno == 2) { - /*if (world.b_t != "" && world.b_t != string_null) + /*if (world.b_t != "" && world.b_t) { return world.b_t; }*/ st = infokey(world, "team2"); - if (st == string_null) + if (!st) st = infokey(world, "t2"); - if (st == string_null || st == "") + if (!st) return "red"; } else if (tno == 3) { - /*if (world.b_n != "" && world.b_n != string_null) + /*if (world.b_n != "" && world.b_n) { return world.b_n; }*/ st = infokey(world, "team3"); - if (st == string_null) + if (!st) st = infokey(world, "t3"); - if (st == string_null || st == "") + if (!st) return "yell"; } else if (tno == 4) { - /*if (world.b_o != "" && world.b_o != string_null) + /*if (world.b_o != "" && world.b_o) { return world.b_o; }*/ st = infokey(world, "team4"); - if (st == string_null) + if (!st) st = infokey(world, "t4"); - if (st == string_null || st == "") + if (!st) return "teal"; } else @@ -380,14 +380,14 @@ void() TeamFortress_CheckTeamCheats = #endif //WK Add in hack for "skins" cheat. This is as good a place as any - if (self.netname == string_null) { + if (!self.netname) { stuffcmd(self,"name \"I'm a cheater even when RENAMED\"\n"); stuffcmd(self,"disconnect\n"); } //WK Limit rate to 10k? st = infokey(self,"rate"); - if (st != string_null) + if (st) rate = stof(st); if (rate > 10000) { stuffcmd(self,"rate 10000\n"); @@ -876,7 +876,7 @@ void(entity Player) TeamFortress_TeamShowMemberClasses = { if (((e.team_no == Player.team_no) || (e.team_no == 0)) && (e != Player)) { - if (e.model != string_null) // check if valid player + if (e.model) // check if valid player { if (!found) { diff --git a/warlock.qc b/warlock.qc index baf0e31..04e80cf 100644 --- a/warlock.qc +++ b/warlock.qc @@ -406,9 +406,9 @@ void(entity demon) custom_demon_name = if (demon.has_camera == 3 || demon.has_camera == 4) //CH // SB - if we have a d already, use rand name { happy = infokey(demon.real_owner,"demon"); - if (happy == string_null) + if (!happy) happy = infokey(demon.real_owner,"d"); - if (happy == string_null) + if (!happy) demon.has_camera = 2; else demon.has_camera = 3; diff --git a/weapons.qc b/weapons.qc index c97d8a6..fd7e40b 100644 --- a/weapons.qc +++ b/weapons.qc @@ -3833,7 +3833,7 @@ void() CycleWeaponCommand = local float it, am, cont, loopcount; // Some safety code - if (self.weaponmodel == string_null || self.current_weapon == 0) + if (!self.weaponmodel || self.current_weapon == 0) return; if (self.tfstate & TFSTATE_RELOADING) diff --git a/world.qc b/world.qc index 8b8de77..b84bb67 100644 --- a/world.qc +++ b/world.qc @@ -557,6 +557,11 @@ void() StartFrame = fraglimit = cvar("fraglimit"); deathmatch = cvar("deathmatch"); framecount = framecount + 1; + + local string timeleft; + timeleft = timelimit ? sprintf ("%.0f", (timelimit - time) / 60) : ""; + if (timeleft != infokey (world, "timeleft")) + setinfokey (world, "timeleft", timeleft); }; /*