From: TimePath Date: Sat, 3 Oct 2015 07:17:49 +0000 (+1000) Subject: Merge branch 'master' into TimePath/spawnfunc X-Git-Tag: xonotic-v0.8.2~1886^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=541c234fd442f5857209128fc7a907e406f4be03;p=xonotic%2Fxonotic-data.pk3dir.git Merge branch 'master' into TimePath/spawnfunc # Conflicts: # qcsrc/common/turrets/unit/ewheel.qc # qcsrc/common/turrets/unit/flac.qc # qcsrc/common/turrets/unit/fusionreactor.qc # qcsrc/common/turrets/unit/hellion.qc # qcsrc/common/turrets/unit/hk.qc # qcsrc/common/turrets/unit/machinegun.qc # qcsrc/common/turrets/unit/mlrs.qc # qcsrc/common/turrets/unit/phaser.qc # qcsrc/common/turrets/unit/plasma.qc # qcsrc/common/turrets/unit/plasma_dual.qc # qcsrc/common/turrets/unit/tesla.qc # qcsrc/common/turrets/unit/walker.qc # qcsrc/server/t_items.qc --- 541c234fd442f5857209128fc7a907e406f4be03 diff --cc qcsrc/common/turrets/unit/ewheel.qc index d4e632c4c,cd111b258..117e34783 --- a/qcsrc/common/turrets/unit/ewheel.qc +++ b/qcsrc/common/turrets/unit/ewheel.qc @@@ -121,7 -121,7 +121,7 @@@ void ewheel_move_idle( movelib_beak_simple((autocvar_g_turrets_unit_ewheel_speed_stop)); } - spawnfunc(turret_ewheel) { if(!turret_initialize(TUR_EWHEEL)) remove(self); } -void spawnfunc_turret_ewheel() { SELFPARAM(); if(!turret_initialize(TUR_EWHEEL.m_id)) remove(self); } ++spawnfunc(turret_ewheel) { if(!turret_initialize(TUR_EWHEEL.m_id)) remove(self); } float t_ewheel(float req) {SELFPARAM(); diff --cc qcsrc/common/turrets/unit/flac.qc index b819ae950,e19116067..3b9330f7e --- a/qcsrc/common/turrets/unit/flac.qc +++ b/qcsrc/common/turrets/unit/flac.qc @@@ -28,7 -28,7 +28,7 @@@ void turret_flac_projectile_think_explo remove(self); } - spawnfunc(turret_flac) { if(!turret_initialize(TUR_FLAC)) remove(self); } -void spawnfunc_turret_flac() { SELFPARAM(); if(!turret_initialize(TUR_FLAC.m_id)) remove(self); } ++spawnfunc(turret_flac) { if(!turret_initialize(TUR_FLAC.m_id)) remove(self); } float t_flac(float req) {SELFPARAM(); diff --cc qcsrc/common/turrets/unit/fusionreactor.qc index c1e2f5d45,5a8df2aad..3b6389a96 --- a/qcsrc/common/turrets/unit/fusionreactor.qc +++ b/qcsrc/common/turrets/unit/fusionreactor.qc @@@ -40,7 -40,7 +40,7 @@@ bool turret_fusionreactor_firecheck( return true; } - spawnfunc(turret_fusionreactor) { if(!turret_initialize(TUR_FUSIONREACTOR)) remove(self); } -void spawnfunc_turret_fusionreactor() { SELFPARAM(); if(!turret_initialize(TUR_FUSIONREACTOR.m_id)) remove(self); } ++spawnfunc(turret_fusionreactor) { if(!turret_initialize(TUR_FUSIONREACTOR.m_id)) remove(self); } float t_fusionreactor(float req) {SELFPARAM(); diff --cc qcsrc/common/turrets/unit/hellion.qc index 1b798bbaa,56f5da90a..a253d20ed --- a/qcsrc/common/turrets/unit/hellion.qc +++ b/qcsrc/common/turrets/unit/hellion.qc @@@ -76,7 -76,7 +76,7 @@@ void turret_hellion_missile_think( UpdateCSQCProjectile(self); } - spawnfunc(turret_hellion) { if(!turret_initialize(TUR_HELLION)) remove(self); } -void spawnfunc_turret_hellion() { SELFPARAM(); if(!turret_initialize(TUR_HELLION.m_id)) remove(self); } ++spawnfunc(turret_hellion) { if(!turret_initialize(TUR_HELLION.m_id)) remove(self); } float t_hellion(float req) {SELFPARAM(); diff --cc qcsrc/common/turrets/unit/hk.qc index 4dcbe9592,106c982ae..25235734b --- a/qcsrc/common/turrets/unit/hk.qc +++ b/qcsrc/common/turrets/unit/hk.qc @@@ -273,7 -273,7 +273,7 @@@ float turret_hk_addtarget(entity e_targ return 0; } - spawnfunc(turret_hk) { if(!turret_initialize(TUR_HK)) remove(self); } -void spawnfunc_turret_hk() { SELFPARAM(); if(!turret_initialize(TUR_HK.m_id)) remove(self); } ++spawnfunc(turret_hk) { if(!turret_initialize(TUR_HK.m_id)) remove(self); } float t_hk(float req) {SELFPARAM(); diff --cc qcsrc/common/turrets/unit/machinegun.qc index bde4f560b,35f1921ed..eeb889022 --- a/qcsrc/common/turrets/unit/machinegun.qc +++ b/qcsrc/common/turrets/unit/machinegun.qc @@@ -11,7 -11,7 +11,7 @@@ REGISTER_TURRET ); #else #ifdef SVQC - spawnfunc(turret_machinegun) { if(!turret_initialize(TUR_MACHINEGUN)) remove(self); } -void spawnfunc_turret_machinegun() { SELFPARAM(); if(!turret_initialize(TUR_MACHINEGUN.m_id)) remove(self); } ++spawnfunc(turret_machinegun) { if(!turret_initialize(TUR_MACHINEGUN.m_id)) remove(self); } void W_MachineGun_MuzzleFlash(void); diff --cc qcsrc/common/turrets/unit/mlrs.qc index 9ae666307,21e0a435d..7e130c6e1 --- a/qcsrc/common/turrets/unit/mlrs.qc +++ b/qcsrc/common/turrets/unit/mlrs.qc @@@ -11,7 -11,7 +11,7 @@@ REGISTER_TURRET ); #else #ifdef SVQC - spawnfunc(turret_mlrs) { if(!turret_initialize(TUR_MLRS)) remove(self); } -void spawnfunc_turret_mlrs() { SELFPARAM(); if(!turret_initialize(TUR_MLRS.m_id)) remove(self); } ++spawnfunc(turret_mlrs) { if(!turret_initialize(TUR_MLRS.m_id)) remove(self); } float t_mlrs(float req) {SELFPARAM(); diff --cc qcsrc/common/turrets/unit/phaser.qc index ca947623e,04e226448..6eec37ab4 --- a/qcsrc/common/turrets/unit/phaser.qc +++ b/qcsrc/common/turrets/unit/phaser.qc @@@ -57,7 -57,7 +57,7 @@@ void beam_think( } - spawnfunc(turret_phaser) { if(!turret_initialize(TUR_PHASER)) remove(self); } -void spawnfunc_turret_phaser() { SELFPARAM(); if(!turret_initialize(TUR_PHASER.m_id)) remove(self); } ++spawnfunc(turret_phaser) { if(!turret_initialize(TUR_PHASER.m_id)) remove(self); } float t_phaser(float req) {SELFPARAM(); diff --cc qcsrc/common/turrets/unit/plasma.qc index 36966a1ae,baafa51c6..59c0f850a --- a/qcsrc/common/turrets/unit/plasma.qc +++ b/qcsrc/common/turrets/unit/plasma.qc @@@ -11,7 -11,7 +11,7 @@@ REGISTER_TURRET ); #else #ifdef SVQC - spawnfunc(turret_plasma) { if(!turret_initialize(TUR_PLASMA)) remove(self); } -void spawnfunc_turret_plasma() { SELFPARAM(); if(!turret_initialize(TUR_PLASMA.m_id)) remove(self); } ++spawnfunc(turret_plasma) { if(!turret_initialize(TUR_PLASMA.m_id)) remove(self); } float t_plasma(float req) {SELFPARAM(); diff --cc qcsrc/common/turrets/unit/plasma_dual.qc index 6469c0591,bf3362ab8..edcf7ed21 --- a/qcsrc/common/turrets/unit/plasma_dual.qc +++ b/qcsrc/common/turrets/unit/plasma_dual.qc @@@ -11,7 -11,7 +11,7 @@@ REGISTER_TURRET ); #else #ifdef SVQC - spawnfunc(turret_plasma_dual) { if(!turret_initialize(TUR_PLASMA_DUAL)) remove(self); } -void spawnfunc_turret_plasma_dual() { SELFPARAM(); if(!turret_initialize(TUR_PLASMA_DUAL.m_id)) remove(self); } ++spawnfunc(turret_plasma_dual) { if(!turret_initialize(TUR_PLASMA_DUAL.m_id)) remove(self); } float t_plasma_dual(float req) {SELFPARAM(); diff --cc qcsrc/common/turrets/unit/tesla.qc index 76f8083a9,d3c894b96..ebcc4e997 --- a/qcsrc/common/turrets/unit/tesla.qc +++ b/qcsrc/common/turrets/unit/tesla.qc @@@ -89,7 -89,7 +89,7 @@@ float turret_tesla_firecheck( return 0; } - spawnfunc(turret_tesla) { if(!turret_initialize(TUR_TESLA)) remove(self); } -void spawnfunc_turret_tesla() { SELFPARAM(); if(!turret_initialize(TUR_TESLA.m_id)) remove(self); } ++spawnfunc(turret_tesla) { if(!turret_initialize(TUR_TESLA.m_id)) remove(self); } float t_tesla(float req) {SELFPARAM(); diff --cc qcsrc/common/turrets/unit/walker.qc index ceacde8c2,792e7a338..a2927cfbf --- a/qcsrc/common/turrets/unit/walker.qc +++ b/qcsrc/common/turrets/unit/walker.qc @@@ -334,7 -334,7 +334,7 @@@ void walker_move_path( #endif } - spawnfunc(turret_walker) { if(!turret_initialize(TUR_WALKER)) remove(self); } -void spawnfunc_turret_walker() { SELFPARAM(); if(!turret_initialize(TUR_WALKER.m_id)) remove(self); } ++spawnfunc(turret_walker) { if(!turret_initialize(TUR_WALKER.m_id)) remove(self); } float t_walker(float req) {SELFPARAM(); diff --cc qcsrc/lib/_all.inc index 2b15e8acb,cda9b3a88..e7ee2746f --- a/qcsrc/lib/_all.inc +++ b/qcsrc/lib/_all.inc @@@ -19,8 -20,8 +20,9 @@@ #include "prandom.qc" #include "progname.qh" #include "registry.qh" + #include "replicate.qh" #include "sortlist.qc" +#include "spawnfunc.qh" #include "static.qh" #include "string.qh" #include "struct.qh" diff --cc qcsrc/server/mutators/gamemode_nexball.qc index 0227f9687,a318748fd..3675831ac --- a/qcsrc/server/mutators/gamemode_nexball.qc +++ b/qcsrc/server/mutators/gamemode_nexball.qc @@@ -619,19 -619,19 +619,19 @@@ spawnfunc(nexball_pinkgoal SpawnGoal(); } -void spawnfunc_nexball_fault(void) -{SELFPARAM(); +spawnfunc(nexball_fault) +{ self.team = GOAL_FAULT; if(self.noise == "") - self.noise = "misc/typehit.wav"; + self.noise = SND(TYPEHIT); SpawnGoal(); } -void spawnfunc_nexball_out(void) -{SELFPARAM(); +spawnfunc(nexball_out) +{ self.team = GOAL_OUT; if(self.noise == "") - self.noise = "misc/typehit.wav"; + self.noise = SND(TYPEHIT); SpawnGoal(); } diff --cc qcsrc/server/t_items.qc index c256d4df9,7d3e59836..015d4aeb2 --- a/qcsrc/server/t_items.qc +++ b/qcsrc/server/t_items.qc @@@ -1199,18 -1200,11 +1200,11 @@@ void StartItem (string itemmodel, strin void StartItemA (entity a) {SELFPARAM(); self.itemdef = a; - StartItem(Item_Model(a.m_model), a.m_sound, a.m_respawntime(), a.m_respawntimejitter(), a.m_name, a.m_itemid, 0, a.m_itemflags, a.m_pickupevalfunc, a.m_botvalue); + StartItem(strzone(a.m_model.model_str()), a.m_sound, a.m_respawntime(), a.m_respawntimejitter(), a.m_name, a.m_itemid, 0, a.m_itemflags, a.m_pickupevalfunc, a.m_botvalue); } -void spawnfunc_item_rockets() -{SELFPARAM(); +spawnfunc(item_rockets) +{ if(!self.ammo_rockets) self.ammo_rockets = g_pickup_rockets; if(!self.pickup_anyway) @@@ -1363,15 -1357,14 +1357,14 @@@ spawnfunc(item_health_mega } // support old misnamed entities -void spawnfunc_item_armor1() { spawnfunc_item_armor_small(); } // FIXME: in Quake this is green armor, in Xonotic maps it is an armor shard -void spawnfunc_item_armor25() { spawnfunc_item_armor_large(); } -void spawnfunc_item_health1() { spawnfunc_item_health_small(); } -void spawnfunc_item_health25() { spawnfunc_item_health_medium(); } -void spawnfunc_item_health100() { spawnfunc_item_health_mega(); } +spawnfunc(item_armor1) { spawnfunc_item_armor_small(this); } // FIXME: in Quake this is green armor, in Xonotic maps it is an armor shard +spawnfunc(item_armor25) { spawnfunc_item_armor_large(this); } +spawnfunc(item_health1) { spawnfunc_item_health_small(this); } +spawnfunc(item_health25) { spawnfunc_item_health_medium(this); } +spawnfunc(item_health100) { spawnfunc_item_health_mega(this); } -void spawnfunc_item_strength() -{SELFPARAM(); +spawnfunc(item_strength) +{ - precache_sound("weapons/strength_fire.wav"); if(!self.strength_finished) self.strength_finished = autocvar_g_balance_powerup_strength_time; StartItemA (ITEM_Strength);