X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Ft_halflife.qc;h=7719542459324cb695e16169088a662ad77ebbc4;hb=6e0735e995e35d56e60f8b816285077b7db0b155;hp=4f6c1ca0e63585c07586d5356551989f1e8af445;hpb=244e5081c5c503c307e557c98ac864f6c9731475;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/t_halflife.qc b/qcsrc/server/t_halflife.qc index 4f6c1ca0e..771954245 100644 --- a/qcsrc/server/t_halflife.qc +++ b/qcsrc/server/t_halflife.qc @@ -1,21 +1,4 @@ -#if defined(CSQC) -#elif defined(MENUQC) -#elif defined(SVQC) - #include "../dpdefs/progsdefs.qh" - #include "defs.qh" - #include "vehicles/vehicles_def.qh" -#endif -#include "../warpzonelib/util_server.qh" - -#include "miscfunctions.qh" -#ifdef CSQC -#define EXACTTRIGGER_TOUCH if(WarpZoneLib_ExactTrigger_Touch()) return -#endif - -.float ladder_time; -.entity ladder_entity; - -#ifdef SVQC +#include "t_halflife.qh" .float roomtype; .float radius; .float pitch; @@ -23,147 +6,30 @@ .float rendermode; .vector rendercolor; -void spawnfunc_weapon_crossbow() {} -void spawnfunc_weapon_handgrenade() {} -void spawnfunc_ammo_crossbow() {} -void spawnfunc_ammo_9mmclip() {} -void spawnfunc_ammo_gaussclip() {} -void spawnfunc_weapon_rpg() {} -void spawnfunc_weapon_357() {} +spawnfunc(weapon_crossbow) {} +spawnfunc(weapon_handgrenade) {} +spawnfunc(ammo_crossbow) {} +spawnfunc(ammo_9mmclip) {} +spawnfunc(ammo_gaussclip) {} +spawnfunc(weapon_rpg) {} +spawnfunc(weapon_357) {} void ammo_ARgrenades() {} -void spawnfunc_item_battery() {} -void spawnfunc_ammo_rpgclip() {} +spawnfunc(item_battery) {} +spawnfunc(ammo_rpgclip) {} void weapon_9mmAR() {} -void spawnfunc_weapon_tripmine() {} -void spawnfunc_weapon_snark() {} -void spawnfunc_ammo_buckshot() {} +spawnfunc(weapon_tripmine) {} +spawnfunc(weapon_snark) {} +spawnfunc(ammo_buckshot) {} void ammo_9mmAR() {} -void spawnfunc_ammo_357() {} -void spawnfunc_weapon_gauss() {} -void spawnfunc_weapon_hornetgun() {} -//void spawnfunc_weapon_shotgun() {} -void spawnfunc_item_healthkit() {} -void spawnfunc_item_longjump() {} -void spawnfunc_item_antidote() {} -void spawnfunc_func_recharge() {} -void spawnfunc_info_node() {} -void spawnfunc_env_sound() {} -void spawnfunc_light_spot() {} -void spawnfunc_func_healthcharger() {} -#endif - -void func_ladder_touch() -{ -#ifdef SVQC - if (!other.iscreature) - return; - if (other.vehicle_flags & VHF_ISVEHICLE) - return; -#endif -#ifdef CSQC - if(other.classname != "csqcmodel") - return; -#endif - - EXACTTRIGGER_TOUCH; - - other.ladder_time = time + 0.1; - other.ladder_entity = self; -} - -#ifdef SVQC -float func_ladder_send(entity to, float sf) -{ - WriteByte(MSG_ENTITY, ENT_CLIENT_LADDER); - - WriteString(MSG_ENTITY, self.classname); - WriteByte(MSG_ENTITY, self.warpzone_isboxy); - WriteByte(MSG_ENTITY, self.skin); - WriteByte(MSG_ENTITY, self.speed); - WriteByte(MSG_ENTITY, self.scale); - WriteCoord(MSG_ENTITY, self.origin_x); - WriteCoord(MSG_ENTITY, self.origin_y); - WriteCoord(MSG_ENTITY, self.origin_z); - - WriteCoord(MSG_ENTITY, self.mins_x); - WriteCoord(MSG_ENTITY, self.mins_y); - WriteCoord(MSG_ENTITY, self.mins_z); - WriteCoord(MSG_ENTITY, self.maxs_x); - WriteCoord(MSG_ENTITY, self.maxs_y); - WriteCoord(MSG_ENTITY, self.maxs_z); - - WriteCoord(MSG_ENTITY, self.movedir_x); - WriteCoord(MSG_ENTITY, self.movedir_y); - WriteCoord(MSG_ENTITY, self.movedir_z); - - WriteCoord(MSG_ENTITY, self.angles_x); - WriteCoord(MSG_ENTITY, self.angles_y); - WriteCoord(MSG_ENTITY, self.angles_z); - - return true; -} - -void func_ladder_link() -{ - Net_LinkEntity(self, false, 0, func_ladder_send); -} - -void spawnfunc_func_ladder() -{ - EXACTTRIGGER_INIT; - self.touch = func_ladder_touch; - - func_ladder_link(); -} - -void spawnfunc_func_water() -{ - EXACTTRIGGER_INIT; - self.touch = func_ladder_touch; - - func_ladder_link(); -} - -#elif defined(CSQC) -.float speed; - -void func_ladder_draw() -{ - float dt = time - self.move_time; - self.move_time = time; - if(dt <= 0) { return; } - - trigger_touch_generic(func_ladder_touch); -} - -void ent_func_ladder() -{ - self.classname = strzone(ReadString()); - self.warpzone_isboxy = ReadByte(); - self.skin = ReadByte(); - self.speed = ReadByte(); - self.scale = ReadByte(); - self.origin_x = ReadCoord(); - self.origin_y = ReadCoord(); - self.origin_z = ReadCoord(); - setorigin(self, self.origin); - self.mins_x = ReadCoord(); - self.mins_y = ReadCoord(); - self.mins_z = ReadCoord(); - self.maxs_x = ReadCoord(); - self.maxs_y = ReadCoord(); - self.maxs_z = ReadCoord(); - setsize(self, self.mins, self.maxs); - self.movedir_x = ReadCoord(); - self.movedir_y = ReadCoord(); - self.movedir_z = ReadCoord(); - self.angles_x = ReadCoord(); - self.angles_y = ReadCoord(); - self.angles_z = ReadCoord(); - - self.solid = SOLID_TRIGGER; - self.draw = func_ladder_draw; - self.drawmask = MASK_NORMAL; - self.move_time = time; -} -#endif +spawnfunc(ammo_357) {} +spawnfunc(weapon_gauss) {} +spawnfunc(weapon_hornetgun) {} +//spawnfunc(weapon_shotgun) {} +spawnfunc(item_healthkit) {} +spawnfunc(item_longjump) {} +spawnfunc(item_antidote) {} +spawnfunc(func_recharge) {} +spawnfunc(info_node) {} +spawnfunc(env_sound) {} +spawnfunc(light_spot) {} +spawnfunc(func_healthcharger) {}