#include "tests.qh"
-void test_weapons_hurt() {
- SELFPARAM();
- EXPECT_NE(100, this.health);
- remove(this.enemy);
- remove(this);
+void test_weapons_hurt(entity this)
+{
+ EXPECT_NE(100, GetResource(this, RES_HEALTH));
+ delete(this.enemy);
+ delete(this);
}
TEST(Weapons, Hurt)
{
entity it;
- Client a = it = NEW(Client, "A");
+ noref Client a = it = NEW(Client, "A");
WITH(float, autocvar_g_spawnshieldtime, 0, Client_Add(it, NUM_TEAM_1));
it.origin = '-100 0 0';
it.angles = '0 0 0';
- Client b = it = NEW(Client, "B");
+ noref Client b = it = NEW(Client, "B");
WITH(float, autocvar_g_spawnshieldtime, 0, Client_Add(it, NUM_TEAM_2));
it.origin = '100 0 0';
it.angles = '0 180 0';
it.items |= IT_UNLIMITED_AMMO;
Weapon wep = WEP_VORTEX;
W_GiveWeapon(it, wep.m_id);
- W_SwitchWeapon_Force(it, wep);
+ W_SwitchWeapon_Force(it, wep, weaponentities[0]);
it = b;
PHYS_INPUT_BUTTON_JUMP(it) = true;
SUCCEED();
}
+
+TEST(Vehicles, Spawn)
+{
+ entity it;
+
+ noref Client bot = it = NEW(Client, "Rider");
+ Client_Add(it, NUM_TEAM_1);
+ it.origin = '0 0 100';
+
+ noref entity v = it = new(vehicle);
+ Vehicle veh = VEH_BUMBLEBEE;
+ it.active = ACTIVE_NOT;
+ vehicle_initialize(it, veh, false);
+ it.nextthink = time;
+
+ SUCCEED();
+}