X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Ftests.qc;h=50dc5a35bca7cd130b7732fe141819539bc64e01;hb=ecebe32dc00c4236a4050b73a9dcc9afbcddf087;hp=0b153fff1e4cc3f472089f90fcbf15b0529e0921;hpb=f72821fdcebe3ca01181a99727a06198de65ea08;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/tests.qc b/qcsrc/server/tests.qc index 0b153fff1..50dc5a35b 100644 --- a/qcsrc/server/tests.qc +++ b/qcsrc/server/tests.qc @@ -1,22 +1,22 @@ #include "tests.qh" -void test_weapons_hurt() { - SELFPARAM(); +void test_weapons_hurt(entity this) +{ EXPECT_NE(100, this.health); - remove(this.enemy); - remove(this); + 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'; @@ -26,7 +26,7 @@ TEST(Weapons, Hurt) 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; @@ -36,3 +36,20 @@ TEST(Weapons, Hurt) 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(); +}