qcsrc/menu/fteqcc.log
qcsrc/server/fteqcc.log
weapons.qc.tmp
+*.lno
set g_balance_nex_charge_maxspeed 800
set g_balance_nex_switchdelay_drop 0.3
-set g_balance_nex_switchdelay_raise 0.3
+set g_balance_nex_switchdelay_raise 0.25
set g_balance_nex_reload_ammo 0 //default: 25
set g_balance_nex_reload_time 2
set g_balance_nex_charge_maxspeed 800
set g_balance_nex_switchdelay_drop 0.3
-set g_balance_nex_switchdelay_raise 0.3
+set g_balance_nex_switchdelay_raise 0.25
set g_balance_nex_reload_ammo 0 //default: 25
set g_balance_nex_reload_time 2
// =================================
// when variables are set to anything other than 0, they take over the global setting...
// to force disable delay or waves, set them to 0.125
-set g_ctf_respawn_delay 0
+set g_ctf_respawn_delay 5
set g_ctf_respawn_waves 0
set g_ctf_weapon_stay 0
set g_dm_respawn_delay 0
../common/teams.qh
../common/util.qh
+../common/test.qh
../common/counting.qh
../common/items.qh
../common/explosion_equation.qh
bgmscript.qc
noise.qc
+../common/test.qc
../common/util.qc
../common/notifications.qc
../common/command/markup.qc
}
}
+void GenericCommand_runtest(float request, float argc)
+{
+ switch(request)
+ {
+ case CMD_REQUEST_COMMAND:
+ {
+ if(argc > 1)
+ {
+ float i;
+ for(i = 1; i < argc; ++i)
+ TEST_Run(argv(i));
+ }
+ else
+ TEST_RunAll();
+ return;
+ }
+
+ default:
+ case CMD_REQUEST_USAGE:
+ {
+ print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " [function to run]"));
+ return;
+ }
+ }
+}
+
/* use this when creating a new command, making sure to place it in alphabetical order... also,
** ADD ALL NEW COMMANDS TO commands.cfg WITH PROPER ALIASES IN THE SAME FASHION!
void GenericCommand_(float request)
GENERIC_COMMAND("rpn", GenericCommand_rpn(request, arguments, command), "RPN calculator") \
GENERIC_COMMAND("settemp", GenericCommand_settemp(request, arguments), "Temporarily set a value to a cvar which is restored later") \
GENERIC_COMMAND("settemp_restore", GenericCommand_settemp_restore(request, arguments), "Restore all cvars set by settemp command") \
+ GENERIC_COMMAND("runtest", GenericCommand_runtest(request, arguments), "Run unit tests") \
/* nothing */
void GenericCommand_macro_help()
--- /dev/null
+float TEST_failed;
+float TEST_ok;
+
+void TEST_Fail(string cond)
+{
+ print(sprintf("Assertion failed: ", cond));
+ //backtrace();
+ ++TEST_failed;
+}
+
+void TEST_OK()
+{
+ TEST_ok = TRUE;
+}
+
+float TEST_RunAll()
+{
+ float f = 0;
+ float n = numentityfields();
+ float i;
+ for(i = 0; i < n; ++i)
+ {
+ string name = entityfieldname(i);
+ if(substring(name, 0, 6) == "_TEST_")
+ if(!TEST_Run(substring(name, 6, -1)))
+ ++f;
+ }
+ if(f)
+ {
+ print(sprintf("%d tests failed\n", f));
+ return 1;
+ }
+ else
+ {
+ print(sprintf("All tests OK\n", f));
+ return 0;
+ }
+}
+
+float TEST_Run(string s)
+{
+ print(sprintf("%s: testing...\n", s));
+ TEST_failed = TEST_ok = 0;
+ callfunction(strcat("_TEST_", s));
+ if(TEST_failed > 0)
+ {
+ print(sprintf("%s: %d items failed.\n", s, TEST_failed));
+ return 0;
+ }
+ else if(!TEST_ok)
+ {
+ print(sprintf("%s: did not complete.\n", s));
+ return 0;
+ }
+ return 1;
+}
--- /dev/null
+#define TEST_Check(cond) do { if(!(cond)) TEST_Fail(#cond); } while(0)
+
+void TEST_OK();
+void TEST_Fail(string cond);
+
+float TEST_RunAll();
+float TEST_Run(string test);
../warpzonelib/mathlib.qh
../common/util.qh
+../common/test.qh
oo/base.h
classes.c
../common/util.qc
+../common/test.qc
../common/command/markup.qc
../common/command/rpn.qc
../common/command/generic.qc
self.effects &~= (EF_RED | EF_BLUE | EF_ADDITIVE | EF_FULLBRIGHT | EF_FLAME | EF_NODEPTHTEST);
- if(self.alpha < 0 || self.deadflag) // don't apply the flags if the player is gibbed
+ if((self.alpha < 0 || self.deadflag) && !self.vehicle) // don't apply the flags if the player is gibbed
return;
Fire_ApplyDamage(self);
../common/constants.qh
../common/teams.qh
../common/util.qh
+../common/test.qh
../common/counting.qh
../common/items.qh
../common/explosion_equation.qh
../warpzonelib/server.qc
../common/animdecide.qc
+../common/test.qc
../common/util.qc
../common/notifications.qc
spot = vehicles_findgoodexit(spot);
+ // Hide beam
+ if(self.gun3.enemy || !wasfreed(self.gun3.enemy)) {
+ self.gun3.enemy.effects |= EF_NODRAW;
+ }
self.owner.velocity = 0.75 * self.vehicle.velocity + normalize(spot - self.vehicle.origin) * 200;
self.owner.velocity_z += 10;
setorigin(self.owner, spot);
-
- /*if(eject)
- {
- spot = self.origin + v_forward * 100 + '0 0 64';
- spot = vehicles_findgoodexit(spot);
- //setorigin(self.owner , spot);
- self.owner.velocity = (v_up + v_forward * 0.25) * 250;
- self.owner.oldvelocity = self.owner.velocity;
- }
- else
- {
- if(vlen(self.velocity) > autocvar_g_vehicle_bumblebee_speed_forward * 0.5)
- {
- if(vlen(self.velocity) > autocvar_sv_maxairspeed)
- self.owner.velocity = normalize(self.velocity) * autocvar_sv_maxairspeed;
- else
- self.owner.velocity = self.velocity + v_forward * 100;
-
- self.owner.velocity_z += 200;
- spot = self.origin + v_forward * 128 + '0 0 32';
- spot = vehicles_findgoodexit(spot);
- }
- else
- {
- self.owner.velocity = self.velocity * 0.5;
- self.owner.velocity_z += 10;
- spot = self.origin - v_forward * 300 + '0 0 32';
- spot = vehicles_findgoodexit(spot);
- }
- self.owner.oldvelocity = self.owner.velocity;
- //setorigin(self.owner , spot);
- }
- */
antilag_clear(self.owner);
self.owner = world;